Difference between revisions of "0AB2"
Jump to navigation
Jump to search
(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...) |
(page updates) |
||
Line 1: | Line 1: | ||
− | + | {{This|For CLEO for GTA III and Vice City prior to v2.0.0.0, use opcode 05F6.}} | |
− | '''Description''': Returns from a [[SCM function|scm function]] | + | {{Icon|t}} (with [[CLEO]]) |
− | '''Parameter | + | <hr /> |
− | '' | + | '''Description''' |
− | + | : Returns from a [[SCM function|scm function]] | |
+ | '''Syntax''' | ||
+ | |||
+ | '''Parameter''' | ||
+ | : [''int''] | ||
+ | :: Number of values to return | ||
+ | : [''any''] | ||
+ | :: Returned values if there are ones (optional), up to 30 | ||
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. | 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. | ||
Line 9: | Line 16: | ||
In [[0AB1#Example|this example]] 0AB2 returns only one value, which is the value of variable 0@, this value will be copied to the variable $result. | In [[0AB1#Example|this example]] 0AB2 returns only one value, which is the value of variable 0@, this value will be copied to the variable $result. | ||
− | ==Keywords== | + | == Keywords == |
CLEO, scm function, return, ret | CLEO, scm function, return, ret | ||
[[Category:CLEO Opcodes]] | [[Category:CLEO Opcodes]] |
Revision as of 10:00, 2 January 2016
For CLEO for GTA III and Vice City prior to v2.0.0.0, use opcode 05F6.
(with CLEO)
Description
- Returns from a scm function
Syntax
- 0AB2: ret [int] ( [
Parameter
- [int]
- Number of values to return
- [any]
- Returned values if there are ones (optional), up to 30
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