Jump to content

How to carry variables over from a function


Recommended Posts

  • Moderators

Yes, otherwise, local is assumed. I think.

Local is only assumed if the variable is declared within a function (or used in a For/Next eg. For $i where $i would be declared local unless otherwise stated previously, if declared this way, it will be destroyed like a Local variable after the For/Next loop expires).

Example of standard global distinction:

$s_example1 = "apple"
_badwaytodoit()

Func _badwaytodoit()
    MsgBox(64, "$s_example1", $s_example1)
EndFuncoÝ÷ ØÚ-uç%j¸§*.®ö«¦å{ûr¥ë"²Ø^²Ö«¶ÛiØZn+l~ߺ۫yÊx×¾ìb·öYl¢å¢Ç¬×¨Z·*.Á©í¶Þj  hm©oj¸nW¨­©hq©oj¸nW¢g­)ත¬ zܨº)íèZn+h}תâazgâ®Ëp¢é]mëh¦ëZºÚ"µÍÜ
    ][ÝÓ]ÝXÛUÉ][ÝËJ
At the top of your scripts. Edited by SmOke_N

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

Okay that worked thanks. I learned autoit through playing around with it but right now I am in C++ classes and I will probably get in the habit of declaring variable types from now on.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...