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
Zafrusteria
Wanderer


Joined: 11 Oct 2000
Posts: 94
Location: United Kingdom

PostPosted: Sun Jul 27, 2003 12:14 pm   

testing strings
 
How can you check it two strings do NOT match as the following always goes through the true path.

Set the value in a variable lookfor to "The Sands of Sorrow" on the command line.
Then create an alias test1 as below and call it with

test1 "Strange Glowing Sand"

#IF (@lookfor =~ "%2") {#SHOW TRUE} {#SHOW FALSE}

This is also always true

#IF (@lookfor = "%2") {#SHOW TRUE} {#SHOW FALSE}

I'm confused by this anyone got an answer to how I can check two strings?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Jul 27, 2003 5:23 pm   
 
The problem is the double quotes. When you call the alias and enclose Strange Glowing Sand in double quotes, the alias treats the three words as the first parameter, so the all end up on %1.
Reply with quote
Zafrusteria
Wanderer


Joined: 11 Oct 2000
Posts: 94
Location: United Kingdom

PostPosted: Mon Jul 28, 2003 5:58 pm   
 
Sorry that was a typo on my part there it should all be in %1

after expansion in the alias it should be testing
"The Sands of Sorrow" = "Strange Glowing Sand"

or
"The Sands of Sorrow" =~ "Strange Glowing Sand"
Which coms out as TRUE *boggle*
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