User Tools

Site Tools


crpl:docs:call

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
crpl:docs:call [2013/01/14 13:46] – external edit 127.0.0.1crpl:docs:call [2022/06/25 13:17] (current) – Better example Karsten75
Line 1: Line 1:
 +
 +<- [[crpl:crplreference| CRPL reference]] <- [[crpl:crplreference#vars_and_functions|Vars and Functions]]
  
 =====  @FUNC_NAME  ===== =====  @FUNC_NAME  =====
  
-^Arguments^Result^Notation^ +===== Syntax =====
-| | |''(user defined) ''|+
  
 +@FUNCTIONNAME
  
-=== Description === +===== Description ===== 
-Invokes a function.  + 
-Execution passes to the function that is named and returns to the statement  +Invokes a function named **FUNCTIONNAME**. Execution passes to said function and returns to the statement  
-after the call when the function is complete.  +after the call when the function is complete. Arguments can be passed to and received from functions via the stack.
-Arguments can be passed to and received from functions via the stack.+
 === Examples === === Examples ===
-<code> 
-# invoke the function defined as an example at :FUNC_NAME  
-# with the value "35" to get a 35% chance of making  
-# a rapid (speed 100) move.  
-35 @chance if  
- 100 @relocate #Move quickly  
- endif 
-</code>  
  
 +<code 4rpl>
 +3 4 @MyMathFunction Trace  # will print 9 to the stack (3 * 4 - 3)
 +
 +:MyMathFunction
 +   ->b ->        # read 2 items from the stack
 +   <-a <-b * <-a - # multiply both and subtract the first
 +</code> 
  
crpl/docs/call.1358189208.txt.gz · Last modified: 2014/10/01 15:02 (external edit)