|
Leitia Adept
Joined: 04 May 2007 Posts: 292 Location: Boston
|
Posted: 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? |
|
|
|
Leitia Adept
Joined: 04 May 2007 Posts: 292 Location: Boston
|
Posted: 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 <> |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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 |
|
|
|
Leitia Adept
Joined: 04 May 2007 Posts: 292 Location: Boston
|
Posted: 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 |
|
|
|
|
|