|
Private Adept
Joined: 10 Jan 2002 Posts: 264 Location: USA
|
Posted: 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 |
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: 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 :) |
|
|
|
Private Adept
Joined: 10 Jan 2002 Posts: 264 Location: USA
|
Posted: 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 |
|
|
|
Private Adept
Joined: 10 Jan 2002 Posts: 264 Location: USA
|
Posted: 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} |
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Sun Apr 18, 2010 12:14 am |
#show @{@variable.1}.2
|
|
_________________ Taz :) |
|
|
|
Private Adept
Joined: 10 Jan 2002 Posts: 264 Location: USA
|
Posted: 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" |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: 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 |
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: 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 :) |
|
|
|
Private Adept
Joined: 10 Jan 2002 Posts: 264 Location: USA
|
Posted: 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 |
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Tue Apr 20, 2010 9:47 am |
#show %item(@results.2,1)
|
|
_________________ Taz :) |
|
|
|
Private Adept
Joined: 10 Jan 2002 Posts: 264 Location: USA
|
Posted: 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 |
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: 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 :) |
|
|
|
|
|