10 Jul 2006 04:36
Re: How Do You Use Multiple Program Arguments when running an external program?
Alan Martin <alan_au@...>
2006-07-10 02:36:14 GMT
2006-07-10 02:36:14 GMT
Hi Steve, > In case you're interested, I finally dropped the do() > in favor of a direct external command syntax. Good > However, I'm having problems with the if(modem) statement - > it doesn't ever execute the (modem) positive condition. Your new script is all correct except for this line: > if (modem) which should be: if (modem) do That's because "If(condition)" [without do] only affects whether the next one line of code is executed. It does not require an Endif line because Endif is assumed after one next line. If(condition) debug It was true debug This line is always executed Differently, "If(condition)do" affects everything up to its Endif line. So when you want to add an Else section, you must have "do" on the end of your "If(condition)do". When you ran that script, PowerPro should have shown an error message, saying it found an Else without an If(...)do before it. Instead what's actually happening is -- if the condition is true execute the next line which is: C:/WINDOWS/system32/rasphone.exe -h -- if the condition is not true, jump to just after the endif which is: quit So PowerPro is not behaving perfectly if your script has a syntax error but it will behave perfectly if your script is correct. > Also, the debug statements aren't showing the message box. > Is this another case of the literal/variable expression? Excuse me for nitpicking but Debug is not a message box, it is a Debug window. Better use the correct words in our posts to avoid confusion. When you ask PowerPro to show messages with commands such as: message Have a nice day message Something else it makes a new window, a new message box, for each message, so "Something else" will be in a new window, even though there is already a message box on the screen. Debug does it differently. Each time you do a debug command: -- When the Debug window does not already exist, PowerPro makes it exist and then types your debug stuff into it. -- When there is already a Debug window, PowerPro just adds new lines to it. It does not un-minimise it or bring it to the front. If the Debug window is currently minimised, or lurking behind some other window, it stays there. So look for it on the Task Bar and click to restore it to see your new lines have been added. > There is also some inconsistency in the docs - in the main doc > it says in one place s=modem returns "1" or "", "1" or "0" > the rest just 1/0. Actually, Modem returns either 1 [for connected] or 0 [not connected]. so you will find that your line: Win.debug(length(modem)) will always return 1 [the length of "0" is 1] but the script would still work if Modem returned 1 or "" When you use if(condition)do the condition is False if it's either "0" or "" and the condition is True if it's anything else. Even a value like "-1" or "elephants" or "False" will be regarded as a True condition because it's not 0 or "". > Thanks again, Alan! You're welcome :) ------------------------ Yahoo! Groups Sponsor --------------------~--> See what's inside the new Yahoo! Groups email. http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/dkFolB/TM --------------------------------------------------------------------~-> PowerPro can be found here: http://www.ppro.org/ and here: http://ppro.pcrei.com/