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
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Tue Sep 26, 2006 7:16 am   

variable question
 
i'm wondering if it is possible to setup a variable like this

#var @glvl.@clvl %eval(@glvl.clvl+@gxprate)

basically creating a var that will be in the format of a.b, where a is @glvl from my hpbar and @clvl is control lvl from my hpbar, so it will look like 7.master 4343 and 7.amateur 435 and do the same when i get gl 8,9, 10, ect.
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Tue Sep 26, 2006 12:24 pm   
 
in vars a . denotes a sub entry...errr...or something...it's a data record type thing.
is that what you wanted? or you just wanted the . as a placeholder? If so, then I don't think that ~. works, but feel free to try. if not then i'd suggest using a _ for the placeholder instead.
_________________
http://www.Aardwolf.com
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Tue Sep 26, 2006 12:26 pm   
 
Use curly braces to force earlier expansion of your variables that you use to build your variable name. Off the top of my head (i.e., untested, so play with it if it doesn't work):

Code:
#VAR @{glvl.@clvl} %eval(@{glvl.@clvl} + @gxprate)
Reply with quote
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Tue Sep 26, 2006 7:00 pm   
 
larkin was on to what i wanted to do, and i can't find any such way to do it, even after trying your method larkin
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Wed Sep 27, 2006 11:15 am   
 
I did say you might have to play with it. Try variations on the curly braces until you find a combination that works. Maybe @{glvl.@{clvl}} would work?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Sep 27, 2006 10:10 pm   
 
The problem is likely in how your are attempting to name the variables. All variables are supposed to start with a letter followed by any combination of alpha-numeric characters, allowing only the underscore symbol. The use of a period indicates one of a few things: a key to a record variable, an item number in a stringlist, or an element number in an array. So I think you need to really rethink how your looking to name the variable and also how your looking to store the data.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Thu Sep 28, 2006 2:52 pm   
 
*cough* kinda like what I said :-)..sorta..maybe...*shrug*...wtf do i know :-)
_________________
http://www.Aardwolf.com
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