Jump to content

Recommended Posts

Posted

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:

Posted

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 ]---
Posted

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]

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
×
×
  • Create New...