User Tools

Site Tools


prpl:call

<- PRPL reference <- Everything Else 2

@FUNC_NAME (Function Call)

ArgumentsResultNotation
Depends on the function Depends on the function Depends on the function

Description

Execute a function block defined after :FUNC_NAME, returning to this position when done.

Notes:

  • Functions use the same stack and variables as the rest of the script.
  • This is useful for passing arguments.
  • The :FUNC_NAME is essentially a marker for where the script should go when @FUNC_NAME is encountered.
  • When a function finishes, the script keep executing from after the @FUNC_NAME that triggered it

See also: :FUNC_NAME (func)

Examples

1 ->SomeVar
 
10 @Square Trace #Will trace 100
 
:Square # [ number - square ] Describe your function
	->NumberToSquare #Take the argument left on the stack.
	<-NumberToSquare dup mul #Square the number
	<-SomeVar if
		"Something important happened" Trace
	endif
prpl/call.txt · Last modified: 2017/09/23 07:21 by kajacx