Pazago Posted March 15, 2017 Share Posted March 15, 2017 Hey I'm pretty new with AutoIt and just finding my way to it. I have read myself through this forum but I can't figure out what the problem with my code is. I can compile it but when I want to excecute it a get this Error Message: Line 1 (File E "E..... my pfad): Error: Unknown function name. Here is my code: abc = 1 while abc > 51 If (abc > 50) Then SEND("b") a = a++ Else SEND("c") a = a++ EndIf WEnd Thanks a lot Paz Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted March 15, 2017 Moderators Share Posted March 15, 2017 For variables, you need to preface with $ character. It thinks you are calling a function named abc "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Pazago Posted March 15, 2017 Author Share Posted March 15, 2017 Sorry I could not edit my post. I Posted the wrong code the following is the right one. I added one thing now the code starts but doesn't do anything :s #RequireAdmin Const $a = 1 while $a > 51 If ($a > 50) Then SEND("b") $a = $a++ Else SEND("c") $a = $a++ EndIf WEnd Link to comment Share on other sites More sharing options...
Developers Jos Posted March 15, 2017 Developers Share Posted March 15, 2017 6 minutes ago, Pazago said: Const $a = 1 while $a > 51 .. and you seriously wonder why? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted March 15, 2017 Moderators Share Posted March 15, 2017 As Jos is suggesting, it looks like you are trying to jump both feet first into coding without doing any reading. I would suggest you start on our Wiki, and actually learn a few of the concepts, to save yourself additional frustration. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Pazago Posted March 15, 2017 Author Share Posted March 15, 2017 @Jos Well that is akward, I fixed it but now when I want to run the Skript I become the Error: Cannot assign values to constants. (Line 8), but Line 8 ist empty... Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted March 15, 2017 Moderators Share Posted March 15, 2017 Show us your "fixed" code, please "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Pazago Posted March 15, 2017 Author Share Posted March 15, 2017 #RequireAdmin Const $a = 1 while $a < 51 If ($a > 50) Then SEND("{b}") Else SEND("{c}") $a = $a +1 EndIf WEnd Here it is Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted March 15, 2017 Moderators Share Posted March 15, 2017 Once again, if you declare something as a Constant, meaning it NEVER changes, why are you surprised you're receiving an error when you try to change its value? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Pazago Posted March 15, 2017 Author Share Posted March 15, 2017 ... jup that was it, okay I will read myself now through the wiki! Sorry for that dump questions but Thanks alot for the fast help! Link to comment Share on other sites More sharing options...
Luigi Posted March 15, 2017 Share Posted March 15, 2017 (o.O) Local $a = 1 While $a < 51 $a += Send("{c}") WEnd Visit my repository 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