0AB2

From GTAMods Wiki
Revision as of 13:07, 26 December 2008 by Seemann (talk | contribs) (New page: <code>0AB2=-1,ret %1d%</code><br> '''Description''': Returns from a scm function<br> '''Parameter 1''': number of values to return<br> '''Parameters 2-32''': (optional) Re...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

0AB2=-1,ret %1d%
Description: Returns from a scm function
Parameter 1: number of values to return
Parameters 2-32: (optional) Returned values if there are ones
Supports: San Andreas (with CLEO)

This opcode transfers the thread execution back to 0AB1 opcode and stores the returned values in its variables. Total number of returned values must be equal to the number of variables storing the result in 0AB1. If the 0AB2 opcode does not return any values, it must have a 0 as the only parameter, and proper 0AB1 that calls such a function should have no variables to store.

In this example 0AB2 returns only one value, which is the value of variable 0@, this value will be copied to the variable $result.

Keywords

CLEO, scm function, return, ret