Thread: Text Parser
View Single Post
  #14  
Old 05-08-2007, 04:20 AM
Deadly_Killer Deadly_Killer is offline
Registered User
Join Date: Feb 2002
Posts: 227
Deadly_Killer is on a distinguished road
PHP Code:
function onCreated()
{
  
temp.txt "Hello <variable>player.account</variable>. How are you doing on this fine day?";
  
  
this.parseText(temp.txt);
}

function 
parseText(buf)
{
  
temp.tok buf.tokenize(" ");
  
temp.hld temp.tok;
  
  for (
temp.0temp.temp.tok.size(); temp.I++)
  {
    
temp.var = temp.tok[temp.I];
    
    if (
temp.var.starts("<variable>"))
    {
      
temp.str temp.var.substring(10temp.var.pos("</variable>") - 10);
      
      
temp.hld[temp.I] = makevar(temp.str);
    }
  }
  
  for (
temp.var : temp.hldtemp.@= temp.var @ " ";
  
  return 
temp.r;

I made something real quick.
__________________
- Zidane / Zidaya
Reply With Quote