Stuart,

You might consider combining the ls1 - ls5 into a single variable. I assume 
that those variables represent components of a state. You might then be able 
to give the various values meaningful names. That would make the code easier 
to read and maintain.

Ken



----- Original Message ----- 
From: "Stuart Stevenson" <[EMAIL PROTECTED]>
To: <emc-users@lists.sourceforge.net>
Sent: Monday, April 28, 2008 9:47 AM
Subject: Re: [Emc-users] gear shift component


> arrgh - another change this morning
>
> from:
>
>>     if (shifting) {
>>         if ((range =1) && (ls1) && (!ls2) && (ls3) && (!ls4) && (!ls5)) {
>>             shifting = 0;
>>             spin = spincmd;
>>         }
>>         else if ((range =2) && (ls1) && (!ls2) && (!ls3) && (ls4) && 
>> (!ls5)) {
>>             shifting = 0;
>>             spin = spincmd;
>>         }
>>         else if ((range =3) && (!ls1) && (ls2) && (ls3) && (!ls4) && 
>> (!ls5)) {
>>             shifting = 0;
>>             spin = spincmd;
>>         }
>>         else if ((range =4) && (!ls1) && (ls2) && (!ls3) && (ls4) && 
>> (!ls5)) {
>
> to:
>     if (shifting) {
>         if ((range =1) && (ls1) && (!ls2) && (ls3) && (!ls4) && (!tram)) {
>             shifting = 0;
>             spin = spincmd;
>         }
>         else if ((range =2) && (ls1) && (!ls2) && (!ls3) && (ls4) && 
> (!tram)) {
>             shifting = 0;
>             spin = spincmd;
>         }
>         else if ((range =3) && (!ls1) && (ls2) && (ls3) && (!ls4) && 
> (!tram)) {
>             shifting = 0;
>             spin = spincmd;
>         }
>         else if ((range =4) && (!ls1) && (ls2) && (!ls3) && (ls4) && 
> (!tram)) {
>
> thanks
> Stuart
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
> 

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to