Jump to content
Sign in to follow this  
shuko

Someone with fresh set of eyes, spot the reason for undefined variable

Recommended Posts

Could someone tell me why this is giving Undefined variable "_tsk" at the if line. I'd understand if it was null or something, but undefined?

_tsk = [];
_tsk = (TASKS select _i);
if ((_tsk select 0) == _g) then {

Whole file (Yes, there are _tsk=[] multiple times as Im testing...)

Share this post


Link to post
Share on other sites

Well a guess would be that it gives undefined variable if your TASKS isnt an array-in-an-array variable. What is TASKS? I'm not familiar with Arma briefings at all, lol.

Sidenote: does for "_g" from 0 work in an sqf?

Share this post


Link to post
Share on other sites

Code sure looks intact but I would expect a "select error" since you run from 0 to count and not 0 to count -1.

would be intresting to see the data that comes with "_tsk select 0", maybe the engine interprete it as a varName. The "error positioning" might be illusive too.

Could you paste relevant part from rpt file?

Share this post


Link to post
Share on other sites

  for "_i" from 0 to (count TASKS_SERVER) do {
   for "_g" from 0 to (count TASKS_GROUPS) do {

  ...

I also want to know: is this how For loops are done now?:butbut:

Share this post


Link to post
Share on other sites

Some times if you don't call the code correctly ie missing null off if it's sqf or using exec to call sqf.

_i and _g need to be defined.

Share this post


Link to post
Share on other sites
ODEN;1408739']I would expect a "select error" since you run from 0 to count and not 0 to count -1.

That was it, thanks for helping the blind man. :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×