 |
Ghedemonas Novice
Joined: 15 Aug 2007 Posts: 39
|
Posted: 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 |
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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? |
|
|
|
 |
Dharkael Enchanter

Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: 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." |
|
|
 |
Ghedemonas Novice
Joined: 15 Aug 2007 Posts: 39
|
Posted: Fri Feb 22, 2008 11:09 am |
You are right ... It was late :)
Thanks for the swift help! |
|
|
|
 |
|
|
|