Author Topic: getword problems  (Read 1688 times)

I have a variable that takes a while to load and I have it like this
Code: [Select]
%var2 = getword(%var, 0);%var takes 2 seconds to load, so what happens is it just gives me nothing, blank.
and I know %var has sevral words in it.

It would help if you posted the script.

Try schedualing the process that gives you var 2 to take place in 2 seconds then.

Try schedualing the process that gives you var 2 to take place in 2 seconds then.

didnt work

%var2 gets set instantly, but %var didnt load yet :(

Do you have a %var at all?


Well, sometimes if I have problems I make a "$debug" then echo that to see if it worked.

Set %var as a global variable when it gets declared (e.g. $var = %var;) and use this loop to continue checking for it until it exists.

function checkVar()
{
     if($var !$= "")
     {
          $var2 = getWord($var,0);
     }
     else
     {
          $var2sched = schedule(100,0,"checkVar");
     }
}

You can use cancel($var2sched); if it never finds a result for $var.
« Last Edit: August 21, 2007, 05:04:28 PM by Trader »


No problem.  Glad I could help.

: )