Jump to content

Recommended Posts

Posted (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 by SaeidN
Posted
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

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
  • Recently Browsing   0 members

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