User Tools

Site Tools


4rpl:commands:refexists

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
4rpl:commands:refexists [2021/01/13 17:46] virgilw4rpl:commands:refexists [2021/01/15 07:50] (current) – changed dynamic to reference for consistency Sanian
Line 1: Line 1:
-~~NOTOC~~ + <=[[4rpl:start| Index]] 
-<=[[4rpl:start| Index]]+ 
 +====== Variable Exists (by reference) ====== 
 + 
 +===== Syntax =====
  
-=== Syntax === 
 -?! -?!
  
-=== Description === +===== Description ===== 
-Takes a string from the stack and uses it as a variable name.  + 
-Checks to see if the variable exists (has been assigned).  +Takes a string from the stack and uses it as a variable name. If the variable exists (has been assigned),(true) is pushed to the stack, otherwise (false). 
-If so, 1 is pushed to the stack else 0.+ 
 +===== Examples =====
  
-=== Examples === 
 <code 4rpl> <code 4rpl>
-# Build a string by concatenating "xy" and "z".  +"Santa isn't r-" ->secret
-"xy" "zconcat  +
--?! trace +
-</code+
  
 +if ("secret" -?!)
 +    "I know a secret" Trace
 +else
 +    "I know no secrets" Trace
 +endif
 +</code>
 +
 +~~NOTOC~~
  
4rpl/commands/refexists.txt · Last modified: 2021/01/15 07:50 by Sanian