Jump to content
Sign in to follow this  
PsaltyDS

Reserved words list?

Recommended Posts

PsaltyDS

I was coding along, singing a song... :lmao:

When CRASH! my whole script castle comes down around my ears! o:)

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

Share this post


Link to post
Share on other sites
seandisanti

I was coding along, singing a song... :lmao:

When CRASH! my whole script castle comes down around my ears! o:)

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

Share this post


Link to post
Share on other sites
PsaltyDS

index tab of the help file

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.


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

Share this post


Link to post
Share on other sites
seandisanti

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...

Share this post


Link to post
Share on other sites
SmOke_N

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.

Share this post


Link to post
Share on other sites
Mulawin

I was coding along, singing a song... :lmao:

When CRASH! my whole script castle comes down around my ears! o:)

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 :king:


New Owner of this AU account

Share this post


Link to post
Share on other sites
SmOke_N

sorry not my problem ;)

Guess we'll remember that when you post a question. :lmao:


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.

Share this post


Link to post
Share on other sites
CyberSlug

Avoid using built-in control statements such as Do-While, Select-Case, If-EndIf as function names :lmao:

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!

Share this post


Link to post
Share on other sites
Valik

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. :lmao:

Share this post


Link to post
Share on other sites
seandisanti

sorry not my problem :lmao:

***edit*** removed my original reply, because i was in no state to be posting when i wrote it... Edited by cameronsdad

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×