Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   help with c++ code (http://www.chiefdelphi.com/forums/showthread.php?t=75594)

awad1992 08-03-2009 08:58

help with c++ code
 
hello!
im from team 1946 in israel i just want to ask if we can do more than one (else if) in the same code

in other words , is it correct ?

if(!limitswitch1->Get())
jaguar1->Set(0.0);
Wait(0.05);
jaguar1->Set(0.5);
Wait(0.5);
jaguar1->Set(0.0);
else if (!limitswitch2->Get())
jaguar1->Set(0.0);
Wait(0.05);
jaguar1->Set(-0.5);
Wait(0.5);
jaguar1->Set(0.0);
else if (!limitswitch3 & leftStick->GetRawButton(10)
jaguar1->Set(0.0);
else jaguar1->Set(leftStick->GetZ() );

thanks

byteit101 08-03-2009 12:39

Re: help with c++ code
 
if(!limitswitch1->Get())
{
jaguar1->Set(0.0);
Wait(0.05);
jaguar1->Set(0.5);
Wait(0.5);
jaguar1->Set(0.0);
}
else if (!limitswitch2->Get())
{
jaguar1->Set(0.0);
Wait(0.05);
jaguar1->Set(-0.5);
Wait(0.5);
jaguar1->Set(0.0);
}
else if (!limitswitch3 & leftStick->GetRawButton(10))
{
jaguar1->Set(0.0);
}
else
{
jaguar1->Set(leftStick->GetZ() );
}
yes, as long as you have {}

awad1992 08-03-2009 13:18

Re: help with c++ code
 
thank you very much


All times are GMT -5. The time now is 13:37.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi