Is it possible to have a method return more than one variable?

Is it possible to have a method return more than one variable or are we limited to good old $0?
Thanks in advance for your help.

If you return an object in $0 then you can stuff as many properties as you want into that object, thus returning multiple data points (in one variable). This is one of the reasons why objects are so useful.

Hi Antoine,
as Tim said, you can use the good old $0 as an object, but you can also use an object as in/out, very similarly to a pointer:

<code 4D>
//caller method
C_OBJECT($inOut_o)
$inOut_o:= New object(“name”;“Doe”)
addFirstName ($inOut_o) //pass the object as $1
ASSERT($inOut_o.name=“Doe”)
ASSERT($inOut_o.firstName=“John”) //new property added to object by the method
</code 4D>

<code 4D>
//addFirstName
C_OBJECT($1;$inOut_o)
$inOut_o:=$1
ASSERT($inOut_o.name=“Doe”) //check if property set by the caller is here
$inOut_o.firstName:=“John”
</code 4D>

Note: this will work only if object passed to method is not undefined. To be clearer, if I want to make the above method more secure, I could write:
<code 4D>
C_OBJECT($1;$inOut_o)
$inOut_o:=$1
If (OB is defined($inOut_o))
ASSERT($inOut_o.name=“Doe”)
$inOut_o.firstName:=“John”
Else
ALERT("$1 is undefined, I can’t get or set any property!")
End if
</code 4D>

(The more I learn objects, the more I think they look like enriched pointers…)

Thank you Tim, I had never used objects before. This is exactly what I needed.
Cheers.

Merci Arnaud pour ces précisions très utiles.
Bonne journée.