Sign in to follow this  
Followers 0
PantZ4

Return more than one value?

3 posts in this topic

How to return more than one value?

Seems return only can return one value, so how do other functions do it?

Example:

$MousePos = MouseGetPos()

That will make $MousePos to a array and set in the info in the arrays.

How to?

Thank you :whistle:

Share this post


Link to post
Share on other sites



You return an array:

$anArray = GetTwoValues()

MsgBox(0,'Get Two Values',$anArray[0] & ' - ' & $anArray[1])

Func GetTwoValues()
    Dim $Result[2]
    
    $Result[0] = 'First Value'
    $Result[1] = 'Second Value'
    
    Return $Result
EndFunc

----[ SandyD ]---

Share this post


Link to post
Share on other sites

How to return more than one value?

Seems return only can return one value, so how do other functions do it?

Example:

$MousePos = MouseGetPos()

That will make $MousePos to a array and set in the info in the arrays.

How to?

Thank you :whistle:

If it is an array, it already returns more than 1 value. It is stored in an array as:

$MousePos[0]

$MousePos[1]

$MousePos[2]

$MousePos[3]

...

...

...

...

$MousePos[n]

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