Sign in to follow this  
Followers 0
AcidCorps

Variables from function after EndIf

5 posts in this topic

How do I use a variable set from a function after the function ends

Func _MakeMsg($iText)
    $Text = $iText
EndFunc

_MakeMsg("Hi")
MsgBox(0,"",$Text)

Line 2 (~File~.au3)

Global $Text = $iText)

Global $Text = ^ERROR

Error: Unbalanced brackets in expression

Share this post


Link to post
Share on other sites



Make it a Global variable

Global $Text on top

Share this post


Link to post
Share on other sites
Func _MakeMsg($iText)
    Global $Text = $iText)
EndFunc

_MakeMsg("Hi")
MsgBox(0,"",$Text)oÝ÷ Ù&¦yê뢿êº^.)Þ·
!jƧ{kiºÚqæ­¶ÚÖíÁת޶¯j¸nW¨ºÚ¶ºw-Ú² hm©ZºÚ"µÍÛØ[ ÌÍÕ^[ÈÓXZÙSÙÊ   ÌÍÚU^
BIÌÍÕ^H  ÌÍÚU^[[ÂÓXZÙSÙÊ ][ÝÒI][ÝÊBÙÐÞ
    ][ÝÉ][ÝË    ÌÍÕ^

www.itoady.com

A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Just return it.

Func _MakeMsg($iText)
$Text = $iText
Return $Text
EndFunc

MsgBox(0,""_MakeMsg("Hi"))oÝ÷ ÚÚºÚ"µÍ[ÈÓXZÙSÙÊ ÌÍÚU^
BÌÍÕ^H   ÌÍÚU^]   ÌÍÕ^[[ÂÌÍÕ^HÓXZÙSÙÊ  ][ÝÒI][ÝÊBÙÐÞ
    ][ÝÉ][ÝË    ÌÍÕ^
Edited by weaponx

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  
Followers 0