Hi

I'm trying to create a new flasher for the KAP140 autopilot. This is what I 
have so far:


NewFlasher = {};

NewFlasher.new = func {
  obj = { parents : [NewFlasher],
          count : 0,
          times : arg[1],
          property : arg[0] };
  return obj;
}

NewFlasher.flash = func {
  if (me.count < me.times)
  {
    if (me.property.getValue() == 0)
    {
      me.property.setBoolValue(1);
    }
    elsif (me.property.getValue() == 1)
    {
      me.property.setBoolValue(0);
    }
    me.count = me.count + 1;
    print(me.count, "\n");
    settimer(me.flash, 1.0);
  }
}

testFlasher = NewFlasher.new(annunciatorBeep, 100);
testFlasher.flash();


When i call the flash() method it executes fine the first time, but the second 
time, when it is being called from settimer(), I get this error:

Nasal runtime error: undefined symbol: me
  at /blah-blah/Aircraft/Generic/kap140.nas, line 138

Line 138 is the first if statement in flash().


-- 
Roy Vegard Ovesen

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to