Re: [Flightgear-devel] Weird recent nasal problem

2007-12-07 Thread Melchior FRANZ
* AnMaster -- Saturday 08 December 2007:
 Melchior FRANZ wrote:
  aircraft minus model?  :-}
 Well what do you suggest for storing /sim/aircraft in otherwise?

Err, looks like you didn't get the hint. A '-' in programming
context is a minus, not a hyphen. Although some people seem to
not like this old tradition, as we can read in Lockheed1049.nas:

  # current nasal version doesn't accept :
  # - too many operations on 1 line.
  # - variable with hyphen (?).

Yeah, no hyphens in variables. Later nasal versions won't change
this, I'm afraid.  ;-)

m.



PS: though one can always work around that by referencing
a hpyhen variable via namespace hash/bracket notation.

PPS: the too many operations complaint is bogus

-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Weird recent nasal problem

2007-12-07 Thread Melchior FRANZ
* AnMaster -- Friday 07 December 2007:
 scriptaircraft.HUD.cycle_color()/script
[...]
 Yet I get this for button:
 Nasal runtime error: No such member: HUD
   at /input/joysticks/js/button[3]/binding, line 1

You probably defined a variable named aircraft somewhere else
in the joystick driver file, and this overwrote the aircraft
namespace created by $FG_ROOT/Nasal/aircraft.nas. You have to
know that all Nasal in a joystick driver is in a common Nasal
namespace.

m.

-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


[Flightgear-devel] Weird recent nasal problem

2007-12-07 Thread AnMaster
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

I wanted a button to turn off/on HUD on my joystick so I took a look at the
keyboard binding for it:
 key n=104
  nameh/name
  descHUD Master Switch/desc
  binding
   commandnasal/command
   scriptaircraft.HUD.cycle_color()/script
  /binding
 /key

Now I tried to insert that in my joystick config:
!-- Button B --
button n=3
descHUD Master Switch/desc
binding
commandnasal/command
scriptaircraft.HUD.cycle_color()/script
/binding
/button

Yet I get this for button:
Nasal runtime error: No such member: HUD
  at /input/joysticks/js/button[3]/binding, line 1


While the keyboard binding works fine.


Any idea what could cause this?

By the way this problem happens in both osg and plib and it worked just 2 days
ago in both.

Regards,

AnMaster
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFHWdA8WmK6ng/aMNkRCqo0AKCLajQ1xFzFY/6Gv9TZ+ESPUeNXUQCeOQGK
UsJr2pxbk8ftufQT2/BvHM4=
=Vfp4
-END PGP SIGNATURE-

-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Weird recent nasal problem

2007-12-07 Thread AnMaster
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Melchior FRANZ wrote:
 * AnMaster -- Saturday 08 December 2007:
 Melchior FRANZ wrote:
 aircraft minus model?  :-}
 Well what do you suggest for storing /sim/aircraft in otherwise?
 
 Err, looks like you didn't get the hint. A '-' in programming
 context is a minus, not a hyphen. Although some people seem to
 not like this old tradition, as we can read in Lockheed1049.nas:
Ah, that depends on programming language. Some does allow - in variable names.
Yes I renamed the variable now.
 
   # current nasal version doesn't accept :
   # - too many operations on 1 line.
   # - variable with hyphen (?).
 
 Yeah, no hyphens in variables. Later nasal versions won't change
 this, I'm afraid.  ;-)
 
 m.
 
 
 
 PS: though one can always work around that by referencing
 a hpyhen variable via namespace hash/bracket notation.
 
 PPS: the too many operations complaint is bogus
What complaint?

Oh btw I think this would be easier to discuss on IRC channel.

Regards,

Arvid Norlander
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFHWeIbWmK6ng/aMNkRCmWyAJ411FXgjiKHqMlJhavk2iyZYEnqQgCgsHaH
or5QypzZhBtmMaQOn+NusnE=
=+JKt
-END PGP SIGNATURE-

-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Weird recent nasal problem

2007-12-07 Thread AnMaster
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Melchior FRANZ wrote:
 * AnMaster -- Saturday 08 December 2007:
 Indeed that was what I did, as a way to do aircraft specific mappings. Now I
 renamed the variable to aircraft-model.
 
 aircraft minus model?  :-}
Well what do you suggest for storing /sim/aircraft in otherwise? Doing getprop
on each access I understood as being slower than using a variable as this
variable won't change between each time I access it. Correct?

/AnMaster
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFHWdrsWmK6ng/aMNkRCginAJ0Tmt5jqH8uetT5N1Irxh97NKwLqACeKAre
U3kytF8dDDdpOe+oMJTCIgY=
=O89a
-END PGP SIGNATURE-

-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Weird recent nasal problem

2007-12-07 Thread AnMaster
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Melchior FRANZ wrote:
 * AnMaster -- Saturday 08 December 2007: 
 Melchior FRANZ wrote:
 You probably defined a variable named aircraft somewhere else
 in the joystick driver file, and this overwrote the aircraft
 namespace 
 
 Ah, should call it aircraft-model or something then. Thanks I was
 not aware that nasal would do this.
 
 Nasal doesn't do this by itself. That's a joystick driver feature.
 The same is true in the keyboard.xml file and dialog XML files.
 It allows to define generic parts like functions and variables in
 a separate nasal block, and to use them in all nasal bindings.
 If you define a local aircraft variable, then this will have
 precedence over the a global one.
Indeed that was what I did, as a way to do aircraft specific mappings. Now I
renamed the variable to aircraft-model.

/AnMaster
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFHWdeEWmK6ng/aMNkRCrDhAKCgJ4IcDijoPDgYr0E+oC/LAdtNWwCeLsyN
J9ntvNOcxViwLvGsPfcDq6c=
=dwPr
-END PGP SIGNATURE-

-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Weird recent nasal problem

2007-12-07 Thread Melchior FRANZ
* AnMaster -- Saturday 08 December 2007: 
 Melchior FRANZ wrote:
  You probably defined a variable named aircraft somewhere else
  in the joystick driver file, and this overwrote the aircraft
  namespace 

 Ah, should call it aircraft-model or something then. Thanks I was
 not aware that nasal would do this.

Nasal doesn't do this by itself. That's a joystick driver feature.
The same is true in the keyboard.xml file and dialog XML files.
It allows to define generic parts like functions and variables in
a separate nasal block, and to use them in all nasal bindings.
If you define a local aircraft variable, then this will have
precedence over the a global one.

m. 

-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Weird recent nasal problem

2007-12-07 Thread AnMaster
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512



Melchior FRANZ wrote:
 * AnMaster -- Friday 07 December 2007:
 scriptaircraft.HUD.cycle_color()/script
 [...]
 Yet I get this for button:
 Nasal runtime error: No such member: HUD
   at /input/joysticks/js/button[3]/binding, line 1
 
 You probably defined a variable named aircraft somewhere else
 in the joystick driver file, and this overwrote the aircraft
 namespace created by $FG_ROOT/Nasal/aircraft.nas. You have to
 know that all Nasal in a joystick driver is in a common Nasal
 namespace.
Ah, should call it aircraft-model or something then. Thanks I was not aware that
nasal would do this.

/AnMaster
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFHWdKzWmK6ng/aMNkRCjKjAJ4hWNJEmKK64LuhNUwjAg+RYRoL0wCgnGi5
iC9Ifr7JAsDf07rmIFBRT0o=
=HZrl
-END PGP SIGNATURE-

-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Weird recent nasal problem

2007-12-07 Thread Melchior FRANZ
* AnMaster -- Saturday 08 December 2007:
 Indeed that was what I did, as a way to do aircraft specific mappings. Now I
 renamed the variable to aircraft-model.

aircraft minus model?  :-}

m.

-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel