boolean values in COM / VB / Python

Alex Martelli aleaxit at yahoo.com
Thu Mar 29 09:06:03 EST 2001


"John J. Lee" <phrxy at csv.warwick.ac.uk> wrote in message
news:Pine.SOL.4.30.0103252251210.18627-100000 at mimosa.csv.warwick.ac.uk...
>
> ie.Document.execCommand("SaveAs", false, pathname)
>
> where ie is an Internet Explorer object, pops up a dialogue box, no matter
> what value for false I try, from (1==0, 0, "0", None). According to the MS
> docs at

Yep, the docs do say what you say they say.  But, do they say truth?
Try this small VBScript script...:


WScript.Echo "Start"

Set ie = WScript.CreateObject("InternetExplorer.Application")
WScript.Echo "ie obj created"

ie.Navigate "file://D:\pybridge\bah.htm"
WScript.Echo "Navigated ok"

Set doc = ie.Document
WScript.Echo "Doc gotten"

doc.execCommand "SaveAs", 0, "D:\pybridge\foo.htm"
WScript.Echo "Saved!"


On my box, it hangs just after writing "Doc gotten"... with
some effort (minimize the dosbox and restore it) you get to
see why -- a modal "save file" dialog is being displayed --
you have to clic save or cancel to exit it.

So, apparently, it's not about how to represent Boolean
values in COM/VB/Python -- it's about this .execCommand
not following its documentation/specifications.


After a few years working with MS tools, one learns that
experimental verification of their docs' assertions with
a few different tools is a good idea (...if one hasn't
already learned that previously about ALL docs...:-).


Alex






More information about the Python-list mailing list