Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Xiija
Beginner


Joined: 24 Apr 2018
Posts: 14

PostPosted: Wed Jan 21, 2026 8:24 pm   

syntax help
 
my mud sends a blank or a "yes" as a variable in a prompt...
i tried to figure out the logic/syntax to check for this but failed

Code:


#var myvariable ""
#echo var is: @myvariable
#echo nullish: %null( @myvariable)
#IF (%null( @myvariable)) {#var myvariable "NO"}{}
#echo after: @myvariable
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4790
Location: Pensacola, FL, USA

PostPosted: Thu Jan 22, 2026 7:16 pm   
 
you are missing a space betwween the true and false segments of your if statement, you can also leave the false off if its empty
_________________
Discord server
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4790
Location: Pensacola, FL, USA

PostPosted: Fri Jan 23, 2026 3:32 pm   
 
#IF (%null( @myvariable)) {#var myvariable "NO"}
_________________
Discord server
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net