On samedi 11 octobre 2008, Rob Shearman, Jr. wrote:
> > How can I  pack several pieces of information into one variable?
>
> Binary --> Decimal conversion technique would allow three on/off settings
> to be stored in a decimal number valued 0-7.  Switch one has a value of 1. 
> Switch two has a value of 2.  Switch three has a value of 4.  Add up the
> three and send the results as a single digit.  Because each successive
> switch is assigned a successively higher power of two, the results will be
> unique (no single value can represent more than one possible combination of
> off and on switches.)
>
> Or, combine two three-position switches.  With switch one in position A,
> switch two values are A=0, B=1, C=2.  With switch one in position B, switch
> two values are A=3, B=4, C=5.  With switch one in position C, switch two
> values are A=6, B=7, C=8.  Again, each value has only one possible set of
> positions.
>
> Or combine an on-off switch with a five-position selector.
>
> Any combination of variables with ten or fewer possible unique combinations
> would work.
>
> Cheers,
> -R.
>
> Robert M. Shearman, Jr.
> Transit Operations Supervisor,
> University of Maryland Department of Transportation
> also known as [EMAIL PROTECTED]

Right, i didn't thought  about it

Thanks

-- 
Gérard
http://pagesperso-orange.fr/GRTux/

J'ai décidé d'être heureux parce que c'est bon pour la santé. 
Voltaire


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to