skylark Posted September 19, 2009 Share Posted September 19, 2009 I've searched through the AutoIt help file, and I've searched through this forum without finding an answer. Please could someone tell me why I get a "missing seperator character after keyword" error in the line below? for position = ( 0 + stub ) to seglength step gap What is the key word, and what would the missing character be? I spaced out the text with spaces around the = and + and (), still get the error. This is the first ever piece of coding I've done with AutoIt; previously I would use GWBasic. The line above is part of an algorithmn I am trying to create/test, the full text of what I typed into the editor is appended below. Thanks stub = 0 seglength = 24 gap = 5 for position = ( 0 + stub ) to seglength step gap ; dosomething stub = seglength - position next position MsgBox(0, "stub", stub) Link to comment Share on other sites More sharing options...
Richard Robertson Posted September 19, 2009 Share Posted September 19, 2009 Variables in AutoIt need a $ symbol on the front of the names. $stub, $seglength, $gap, $position, etc. Link to comment Share on other sites More sharing options...
skylark Posted September 19, 2009 Author Share Posted September 19, 2009 (edited) Thanks. That is a disapointment - it requires a lot of extra typing and hassle. GWBasic would I presume deduce that if something was not a keyword then it must be a variable - why does not AutoIt do the same? The editor seems to have no problems doing this. I also see that it will not let me write "next $position" but only "next" - which could cause confusion with nested nexts. Edited September 19, 2009 by skylark Link to comment Share on other sites More sharing options...
Richard Robertson Posted September 19, 2009 Share Posted September 19, 2009 AutoIt was originally written as a VERY simple language. $ on a variable makes the parser simpler. Link to comment Share on other sites More sharing options...
skylark Posted September 19, 2009 Author Share Posted September 19, 2009 Thanks. Would it be possible to get the editor to add the $s before saving the script I wonder? Link to comment Share on other sites More sharing options...
Richard Robertson Posted September 19, 2009 Share Posted September 19, 2009 Nope. The editor would have no way of knowing what you wanted to be a variable and what is a typo. 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