SaeidN Posted October 28, 2016 Posted October 28, 2016 (edited) Hi, I have the below function. I want to send different variable names to this function, and return the result back to where this func is called with different var names. Something like this when calling this func in another func maybe. addComma($oldname, $newname) So it sends the variable $oldname to this func and return it with $newname to where it's been called. How do I do it? Thanks Func addComma() Dim $t, $final $Var = 123456789 $result = StringSplit($var, "") For $x = $result[0] to 1 Step -1 $t = $t +1 If $t = 4 Then $final = "," & $final $t = 1 EndIf $final = $result[$x] & $final Next MsgBox(0, "Results", $final) EndFunc Edited October 28, 2016 by SaeidN
Developers Jos Posted October 28, 2016 Developers Posted October 28, 2016 Just open the Helpfile on the Return command and look at the Byref and Return options also shown in the Example. Jos 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.
SaeidN Posted October 28, 2016 Author Posted October 28, 2016 13 minutes ago, Jos said: Just open the Helpfile on the Return command and look at the Byref and Return options also shown in the Example. Jos Got it to work. Thank you
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