Pazago

[Help] [Simple] If else / While

11 posts in this topic

#1 ·  Posted

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
 

Share this post


Link to post
Share on other sites



#2 ·  Posted

For variables, you need to preface with $ character. It thinks you are calling a function named abc


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted

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

 

Share this post


Link to post
Share on other sites

#5 ·  Posted

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.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#6 ·  Posted

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

Share this post


Link to post
Share on other sites

#7 ·  Posted

Show us your "fixed" code, please


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#9 ·  Posted

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?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#10 ·  Posted

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

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