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
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Sat Jan 03, 2009 7:14 pm   

<@var> forcing wrong case
 
Hi, I wrote a script to make aliases but have this curiosity:

%1=MyCase
#var keepsel %1
#var keepsel %proper(@keepsel)

(or
#var foobar %proper(@keepsel)
#var keepsel @foobar
)


#sh @keepsel

prints:
Mycase

but,

cksela=MY
(@keepsel still is Mycase)

#al @cksela {assist <@keepsel>}
#sh "New alias "@cksela" assigned as 'assist "@keepsel"'"

prints:
New alias MY assigned as 'assist Mycase'

yet the alias written prints in the case of the %1 input:

assist MyCase

-----------

My Questions

Do I need to assign functions because <@var> behaves like this (preserving obsolete case)?

Is this because my puter is messed up?
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Sat Jan 03, 2009 7:20 pm   
 
I would post the whole deal but I have been testing and I changed things I need to test now

idea for me, test <@var> in a new mud setting with simple code

I have enabled expand var and allow for <>
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Jan 03, 2009 9:32 pm   
 
I never recommend the usage of "Allow <> for expand". This particular piece of the script parser was put in in very early versions, something around 5.x. It is was intended for adjusting the command line behavior, but because zMud used the same parser for both the command line and scripts it often causes trouble with scripts. This becomes especially apparent when working with MXP.

I would suggest turing off the option for <>, and using #EXECUTE when you want to force an expansion that is outside of the normal rules.
#EXEC {%concat("#ALIAS ",@cksela," {assist ",@keepsel,"}")}

Also one of your #SHOWs is more properly written as
#sh {New alias @cksela assigned as 'assist @keepsel'}
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Sun Jan 04, 2009 4:08 am   
 
Your reply explained a lot that I was curious about. Also it is great to see your method of doing that. Can't wait to try it.

I forget why I started doing the quotes that way, I think I am confused by some imported #sh or another being cranky.

Thanks much
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