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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Ghedemonas
Novice


Joined: 15 Aug 2007
Posts: 39

PostPosted: Thu Feb 21, 2008 10:45 pm   

Retrieving part of a variable
 
Hi,
a short newbiequestion:

I have a variable @finger.guild.Usual content of the cariable is Newbie, Alchemist, Mage, Pirate, Pirate:xyz etc.
When the content of this variable is pirate_xyz I'd like to retrieve the xyz patz into a new variable. How can I do this?

Thanks very much
Ghedemonas
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Feb 22, 2008 12:56 am   
 
%word(@whatever,1,":")

However, how're you using the format "finger.guild.usual" for a variable name? The . character shouldn't be used in variable names - it's used to select a key from a data record variable. But unless you're setting the table manually from CMUD's Lua interface, there's no way to get a table more than one layer deep. So what's going on?
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Fri Feb 22, 2008 5:25 am   
 
I think its just a punctuation thing Fang
I have a variable @finger.guild.
[The] usual content of the variable is Newbie, Alchemist, Mage...
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
Ghedemonas
Novice


Joined: 15 Aug 2007
Posts: 39

PostPosted: Fri Feb 22, 2008 11:09 am   
 
You are right ... It was late :)
Thanks for the swift help!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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