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


Joined: 27 Feb 2003
Posts: 69
Location: Australia

PostPosted: Mon Jun 28, 2004 3:28 am   

Checking variable contents
 
I'm running into problems using list variables that contain quotes.

Debugging of these problems is made more difficult as I know of no way of checking exactly what the contents of a variable is. Is there a way of seeing the content of a variable without any processing or parsing?

To illustrate the problem ...

#VAR test "This is a test" ;#say @test
#VAR test "This is a~" test" ;#say @test
#VAR test "This is a~" tes~"t" ;#say @test

This is a test
This is a" test
This is a test


In this case, the question I'm trying to answer is ... are the quotes actually in the variable, or are they being stripped out by the parser?


Thanks,
Reply with quote
jessew
Apprentice


Joined: 03 Mar 2003
Posts: 141

PostPosted: Mon Jun 28, 2004 4:08 am   
 
#VAR test "This is a test" Actual Variable: This is a test
#VAR test "This is a~" test" Actual Variable: This is a" test
#VAR test "This is a~" tes~"t" Actual Variable: This is a" tes"t

The outside quotes are not in the variables but the other ones are, whats happening in your third example is they're being parsed out during the #SHOW, you could do #SHOW %quote(@test) to see this or actually look in your settings and check the real value.

Cheers
Reply with quote
Cbisazza
Wanderer


Joined: 27 Feb 2003
Posts: 69
Location: Australia

PostPosted: Mon Jun 28, 2004 4:36 am   
 
Thanks, problem solved.

The quotes were being 'lost' when I was assigning the contents of one variable to another with
#VAR V_1 @{V_2}

Everything works fine now :)


Thanks!
Reply with quote
horks
Apprentice


Joined: 20 Jul 2001
Posts: 127
Location: USA

PostPosted: Fri Jul 02, 2004 6:48 pm   
 
In the prefrences window, under script parser, is a check box for stripping " quotes. If this is not a feature you want, you can uncheck the box
Reply with quote
Cbisazza
Wanderer


Joined: 27 Feb 2003
Posts: 69
Location: Australia

PostPosted: Tue Jul 06, 2004 10:21 am   
 
Thanks, didn't know about that. It's worth looking into.
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