TinTin++ Mud Client Manual
Parse
space
Syntax: #parse {string} {variable} {commands}
space
The parse command works like a simplified loop. Tintin will loop through the given string visiting each character, which will be stored in the given variable and can be used in the commands part.
space
Example: #parse {hello} {character} {say $character!}
space
This equals: say h!;say e!;say l!;say l!;say o!
space
While generally of limited use, parse can be used for some nifty stuff, like using . as a speedwalk command shortcut.
space
Example:
#alias {.%0}
{
        #var cnt {};

        #parse {%0} {char}
        {
                #if {"$char" >= "0" && "$char" <= "9"}
                {
                        #var cnt $cnt$char
                };
                #elseif {"$cnt" == ""}
                {                     
                        $char
                };
                #else
                {    
                        #loop $cnt 1 cnt
                        {
                                $char
                        };
                        #var cnt {}
                }
        }
}
	
space
See also: Break, Continue, Foreach, List, Loop, Repeat, Return and While.
space