PsaltyDS Posted January 17, 2006 Share Posted January 17, 2006 I was coding along, singing a song... When CRASH! my whole script castle comes down around my ears! I traced the problem to one of the functions I created in a new #include file for performing user admin stuff. I formatted some 'NET USER' and 'NET LOCALGROUP' commands into a string variable called $CmdLine and then run it with: $RetCode = RunWait(@ComSpec & " /c " & $CmdLine, @TempDir, @SW_Show) Compiled cleanly, but exploded all over the poor monitor when I tried to run it. Seems the variable $CmdLine is used as a constant by AutoIT to contain the line that called the script or executable. You guys probably new that already, and don't run into that problem. My question is, where do I find a full list of AutoIT "reserved words" and variable/function names that must not be used except as intended? A search through the help file finaly showed me the usage of $CmdLine, but it was not in the index and took some digging. Is there a complete list somewhere? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
seandisanti Posted January 17, 2006 Share Posted January 17, 2006 I was coding along, singing a song... When CRASH! my whole script castle comes down around my ears! I traced the problem to one of the functions I created in a new #include file for performing user admin stuff. I formatted some 'NET USER' and 'NET LOCALGROUP' commands into a string variable called $CmdLine and then run it with:$RetCode = RunWait(@ComSpec & " /c " & $CmdLine, @TempDir, @SW_Show)Compiled cleanly, but exploded all over the poor monitor when I tried to run it. Seems the variable $CmdLine is used as a constant by AutoIT to contain the line that called the script or executable. You guys probably new that already, and don't run into that problem.My question is, where do I find a full list of AutoIT "reserved words" and variable/function names that must not be used except as intended? A search through the help file finaly showed me the usage of $CmdLine, but it was not in the index and took some digging. Is there a complete list somewhere?index tab of the help file Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 18, 2006 Author Share Posted January 18, 2006 index tab of the help fileBeen there, done that, got the collectable mouse pad...I started from the index, no joy; finally found it with the search tab. It wasn't that direct, really, because I thought my error was from use of '$RetCode' at first, then realized it was '$CmdLine'. I've seen reserved word lists in other contexts, just thought there might be one for AutoIT. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
seandisanti Posted January 18, 2006 Share Posted January 18, 2006 Been there, done that, got the collectable mouse pad...I started from the index, no joy; finally found it with the search tab. It wasn't that direct, really, because I thought my error was from use of '$RetCode' at first, then realized it was '$CmdLine'. I've seen reserved word lists in other contexts, just thought there might be one for AutoIT.i haven't seen one for autoit that i can think of... Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 18, 2006 Moderators Share Posted January 18, 2006 Been there, done that, got the collectable mouse pad...I started from the index, no joy; finally found it with the search tab. It wasn't that direct, really, because I thought my error was from use of '$RetCode' at first, then realized it was '$CmdLine'. I've seen reserved word lists in other contexts, just thought there might be one for AutoIT.This actually would come in handy personally... Because the only one I know that was 'reserved' other than keywords was $CmdLine / $CmdLineRaw, I have no idea even if there are others. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Mulawin Posted January 18, 2006 Share Posted January 18, 2006 I was coding along, singing a song... When CRASH! my whole script castle comes down around my ears! I traced the problem to one of the functions I created in a new #include file for performing user admin stuff. I formatted some 'NET USER' and 'NET LOCALGROUP' commands into a string variable called $CmdLine and then run it with:$RetCode = RunWait(@ComSpec & " /c " & $CmdLine, @TempDir, @SW_Show)Compiled cleanly, but exploded all over the poor monitor when I tried to run it. Seems the variable $CmdLine is used as a constant by AutoIT to contain the line that called the script or executable. You guys probably new that already, and don't run into that problem.My question is, where do I find a full list of AutoIT "reserved words" and variable/function names that must not be used except as intended? A search through the help file finaly showed me the usage of $CmdLine, but it was not in the index and took some digging. Is there a complete list somewhere?sorry not my problem New Owner of this AU account Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 18, 2006 Moderators Share Posted January 18, 2006 sorry not my problem Guess we'll remember that when you post a question. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
CyberSlug Posted January 18, 2006 Share Posted January 18, 2006 Avoid using built-in control statements such as Do-While, Select-Case, If-EndIf as function names Call("Select") Func Select() MsgBox(4096,"this","won't work") EndFunc P.S. (In case Valik reads this) I realize that we should not normally use the Call function in these circumstances. Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Valik Posted January 18, 2006 Share Posted January 18, 2006 Avoid using built-in control statements such as Do-While, Select-Case, If-EndIf as function names Call("Select") Func Select() MsgBox(4096,"this","won't work") EndFunc P.S. (In case Valik reads this) I realize that we should not normally use the Call function in these circumstances.I'm more worried about what will happen with this code after JP integrates my changes. I tested that built-in functions failed but I didn't test what happens when you try to call a non-function keyword. Link to comment Share on other sites More sharing options...
seandisanti Posted January 18, 2006 Share Posted January 18, 2006 (edited) sorry not my problem ***edit*** removed my original reply, because i was in no state to be posting when i wrote it... Edited January 18, 2006 by cameronsdad Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now