ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


multiple_return_values

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
multiple_return_values [2019/04/19 21:22] korshunmultiple_return_values [2019/04/19 22:37] korshun
Line 1: Line 1:
 ====== Multiple return values convention ====== ====== Multiple return values convention ======
  
-Some ACSUtils functions return multiple values (e.g. [[math#vector_math|vector math functions]]). ACS doesn't support returning multiple values from a function.+Some ACSUtils functions return multiple values (e.g. [[math#vector_math|vector math functions]], but also some non-math functions). ACS doesn't support returning multiple values from a function.
  
 ACSUtils uses a convention to fake returning multiple values from a function. The convention is as follows: there are 8 global variables with names ''r1'' through ''r8''. If a function returns multiple values, it actually returns no value and writes the first "returned" value to ''r1'', the second one to ''r2'', and so on. ACSUtils uses a convention to fake returning multiple values from a function. The convention is as follows: there are 8 global variables with names ''r1'' through ''r8''. If a function returns multiple values, it actually returns no value and writes the first "returned" value to ''r1'', the second one to ''r2'', and so on.
multiple_return_values.txt · Last modified: 2019/04/22 00:32 by korshun