* Andy Ross -- Monday 25 April 2005 04:20:
> Melchior FRANZ wrote:
> > I'm still hoping for binary ops [...]

> What I'm thinking about instead is a "bits" package with functions
> like:
> 
>    bits.fld(string, startbit, len)
[...] 
>    bits.buf(len)
>        Creates a new, mutable string filled with zeros.

Wouldn't work in my case. Would only make it even less elegant. Then I better
stick with this:

      # mod |= 1;
      mod = getprop(name);
      if (mod == nil) {
          setprop(name, 2);
      } elsif (mod == 0 or mod == 1) {
          setprop(name, mod + 2);
      }

      # mode &= ~1;
      mod = getprop(name);
      if (mod == nil) {
          setprop(name, 0);
      } elsif (mod == 2 or mod == 3) {
          setprop(name, mod - 2);
      }

The problem is that in joystick files I don't have the possibility to 
initialize bit fields or define bit operations. Bindings in joystick
files are executed in "random" order. None is guaranteed to be triggered
at the very beginning. (Although, maybe the <mod-up> part of the first
button binding could be used for that. I'll look into that ...)

m.

_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to