Re: [Flightgear-devel] nasal code problems

2006-03-06 Thread Justin Smithies
Fixed it guys ...

setlistener(/controls/engines/engine/cutoff, func {
var new_cutoff = cmdarg().getBoolValue();
if (new_cutoff == 0 ){
setprop(/controls/engines/engine/reverser, 0);
} else {
if (new_cutoff == 1 ){
setprop(/controls/engines/engine/reverser, 1);
}
}
});


Now i see how this works.

Thanks anyway.
Justin Smithies


On Monday 06 March 2006 15:25, Justin Smithies wrote:
 Hi all can someone fix this test script for me and show me the error of my
 ways.

 Its just a test so dont panic about what it actually does. Just so i can
 see how to affect other values using a script and viewing all on the same
 http page of the property tree makes it easier for me.

 setlistener(/controls/engines/engine/cutoff, func {
 var new_cutoff = cmdarg().getBoolValue();
 if (new_cutoff == 0 ){
 setprop(/controls/engines/engine/reverser, 0);
 } else {
 if (new_cutoff == 1 ){
 setprop(/controls/engines/engine/reverser, 1);
 }
 }
 }

 It is supposed to read the property /controls/engines/engine/cutoff and if
 it is 0 set the property /controls/engines/engine/reverser to 0 and also if
 the cutoff changes to 1 then so should the reverser value change to 1.

 I seem to have the {} () ; wrong somewhere and maybe some other little
 errors.

 Please help

 Justin Smithies


 ---
 This SF.Net email is sponsored by xPML, a groundbreaking scripting language
 that extends applications into web and mobile media. Attend the live
 webcast and join the prime developer group breaking into this new coding
 territory!
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
 ___
 Flightgear-devel mailing list
 Flightgear-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/flightgear-devel


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] nasal code problems

2006-03-06 Thread Andy Ross
Justin Smithies wrote:
 I seem to have the {} () ; wrong somewhere and maybe some other
 little errors.

You didn't close the parentheses in the setlistener() call.  Every (
must be matched with a ) of course.  Programmers use indentation
conventions (and usually special editors) to help with this.

Andy


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel