User Tools

Site Tools


4rpl:commands:refexists

Differences

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

Link to this comparison view

Next revision
Previous revision
4rpl:commands:refexists [2021/01/13 22:44] – created virgilw4rpl:commands:refexists [2025/02/14 14:57] (current) – external edit 127.0.0.1
Line 1: Line 1:
-~~NOTOC~~ + <=[[4rpl:start| Index]]
-<=[[4rpl:start| Index]]+
  
-=== Syntax === +====== Variable Exists (by reference) ======
-<-VAR+
  
-=== Description === +===== Syntax ===== 
-Takes a string from the stack and uses it as a variable name.  + 
-Checks to see if the variable exists (has been assigned).  +-?! 
-If so, 1 is pushed to the stack else 0.+ 
 +===== Description ===== 
 + 
 +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). 
 + 
 +===== 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.1610577857.txt.gz · Last modified: 2025/02/14 14:56 (external edit)