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:20] korshunmultiple_return_values [2019/04/19 21:22] korshun
Line 11: Line 11:
 int newX = r1; int newX = r1;
 int newY = r2; int newY = r2;
-</code> 
- 
-The following is also valid: 
-<code> 
-RotateVector(x, y, angle); 
-x = r1; 
-y = r2; 
-</code> 
- 
-''normalize3d'' returns three values: 
-<code> 
-normalize3d(x, y, z); 
-int newX = r1; 
-int newY = r2; 
-int newZ = r3; 
 </code> </code>
  
Line 47: Line 32:
 </code> </code>
 </note> </note>
 +
 +But overwriting argument variables immediately after calling the function is valid:
 +<code>
 +RotateVector(x, y, angle);
 +x = r1;
 +y = r2;
 +</code>
 +
 +An example of a function returning three values:
 +<code>
 +normalize3d(x, y, z);
 +int newX = r1;
 +int newY = r2;
 +int newZ = r3;
 +</code>
  
multiple_return_values.txt · Last modified: 2019/04/22 00:32 by korshun