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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Fri Apr 09, 2010 9:18 am   

#SHOW @variable.1.2 on command line
 
in zmud i had been using stuff like:

Code:

variable = {(1|2|3)|(4|5|6)|(7|8|9)}
#ALIAS looper {#LOOP %numitems(@variable) {#show @variable.%i.%1}}


>looper 3
3
6
9

>looper 2
2
5
8

This is broken in cmud?


Last edited by Private on Sat Apr 17, 2010 10:01 pm; edited 1 time in total
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Fri Apr 09, 2010 10:36 am   
 
Is the output above the output you get from CMUD or from zMUD? If it's from zMUD then I got the same output in CMUD and can only assume it isn't broken. If the output is from CMUD what was the expect output instead?
_________________
Taz :)
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Fri Apr 09, 2010 12:10 pm   
 
ok, looks like the was i was using #ADDITEM...

my variable was looking like...
>#show @variable
"(1|2|3)"|"(3|4|5)"|"(6|7|8)"

looper dont work on it like that...

changed the was i ADDITEM to disclude the outer () and it looks like...

>#show @variable
"1|2|3"|"3|4|5"|"6|7|8"

and looper works...

i see now that cmud puts double quotes around each row, thanks, made me rethink it :P
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Sat Apr 17, 2010 9:56 pm   
 
ok, this does indeed work from an alias, but i cant seem to #SHOW @variable.1.2 on the command line

#show @variable.1 does indeed show 1|2|3
but
#show @variable.1.2 gives Error parsing command... Illegal property: 2
#show {@variable.1.2} gives Error parsing command... unmatched braces
#show (@variable.1) works
#show (@variable.1.2) gives Error parsing command... Illegal property: 2

so, how do i #show @variable.1.2 from command line?

entering this on the command line also works... but aint what im looking for...

{$x = @variable.1;#show $x.2}
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Sun Apr 18, 2010 12:14 am   
 
#show @{@variable.1}.2
_________________
Taz :)
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Sun Apr 18, 2010 11:19 am   
 
did you try this before posting?

i get:

22007.2

where i should get s

the var has in it at the moment 22007|s

so @variable.1.2 is "s"
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sun Apr 18, 2010 2:20 pm   
 
Taz has it correct. But it may only work if it's a stringlist variable. You may have to do something different if it's a database variable (like #SHOW %db(@variable,1).2 or something like that) to get it to work.

Charneus
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Sun Apr 18, 2010 2:31 pm   
 
Private wrote:
did you try this before posting?

Yep I sure did using the variable you posted.
_________________
Taz :)
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Tue Apr 20, 2010 7:42 am   
 
Code:
  <var name="results" type="StringList" id="6748">"1464|n|a hellhound|53|Flying Citadel|The Labyrinth|13454|0|evil|none|||()|()|()|()|"|"7884|n|a hellhound|166|The Gathering Horde|Inside a Dark, Steel Cage|43814|0|evil||hellhound|A hellhound is trying to KILL YOU!|()|()|(none)|()|"</var>


#show @{@results.2}.1

@7884

expected 7884

#show @{results.2}.1

shows entire 1st record

#show {@results.2}.1

throws an error box
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Tue Apr 20, 2010 9:47 am   
 
#show %item(@results.2,1)
_________________
Taz :)
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Tue Apr 20, 2010 11:54 am   
 
yep that works...

still dunno why it don't work like it used to... #show @variable.1.2
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Tue Apr 20, 2010 12:35 pm   
 
Private wrote:
still dunno why it don't work like it used to... #show @variable.1.2

The only person who can say exactly why is Zugg but hazarding a guess it's probably due to the parser being far more strict.
_________________
Taz :)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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