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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Thu Apr 26, 2007 8:06 pm   

[1.30] %format behaves differently on command line versus elsewhere
 
I have an alias that displays a nice summary of my potions and other vial stuff. This alias calls my "i_info" alias to display the output with a prefix and some pretty colors. When I do it from the command line, I get the result of %format passed to i_info as a single value (%1), and from my pshow alias, it passes it as three separate values (%1, %2, %3) and strips out the spaces I wanted. I figured out that I can out triple double quotes around the %format to make it keep the spaces, but the behavior is still inconsistent.

Code:

#ALIAS i_info {
#SAY %ansi(cyan, blue)~[%ansi(gray, blue)Palisade%ansi(cyan, blue)~]%ansi(gray): %ansi(white)%-1%ansi(gray)
}

#ALIAS pshow {
i_info Potions:
#FORALL @potion_names {
 i_info """%format("  &-15s &3.0n  &4.0n", %i, %db(@my_vials, %i), %db(@my_sips, %i))"""
}
}


(command line that works without quotations)
Code:
i_info %format("  &-15s &3.0n  &4.0n", allheale, %db(@my_vials, allheale), %db(@my_sips, allheale))
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Apr 27, 2007 8:29 pm   
 
I tried playing around with this a bit and couldn't reproduce any problem. You should not need to put any quotes around the %format command in your alias. Since I couldn't get this to fail, can you try simplifying the script for testing, or send me some sample data that I can try. Giving the exact data and commands that you are using to test this would really help.

Here is the simple test that I did:
Code:
#alias i_info {#SHOW info:%-1}
#alias test {#forall %1 {i_info %format("    &s", %i)}}
test a|b|c

This produced the output with the correct spaces in it (between info: and the forall values)


Last edited by Zugg on Tue May 01, 2007 12:21 am; edited 1 time in total
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Mon Apr 30, 2007 7:27 pm   
 
I tried a brand new import of both packages involved in my script that did all this, and it appears that the problem has solved itself. Whatever I saw was apparently not caused by %format. If I see any strange behavior recur, I'll let you know.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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