This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
multiple_return_values [2019/04/19 21:17] – korshun | multiple_return_values [2019/04/19 21:20] – korshun | ||
---|---|---|---|
Line 5: | Line 5: | ||
ACSUtils uses a convention to fake returning multiple values from a function. The convention is as follows: there are 8 global variables with names '' | ACSUtils uses a convention to fake returning multiple values from a function. The convention is as follows: there are 8 global variables with names '' | ||
- | Here's an example, RotateVector returns X and Y: | + | Here's an example, |
< | < | ||
Line 11: | Line 11: | ||
int newX = r1; | int newX = r1; | ||
int newY = r2; | int newY = r2; | ||
+ | </ | ||
+ | |||
+ | The following is also valid: | ||
+ | < | ||
+ | RotateVector(x, | ||
+ | x = r1; | ||
+ | y = r2; | ||
+ | </ | ||
+ | |||
+ | '' | ||
+ | < | ||
+ | normalize3d(x, | ||
+ | int newX = r1; | ||
+ | int newY = r2; | ||
+ | int newZ = r3; | ||
</ | </ | ||