Jump to content
Sign in to follow this  
spokes2112

Problem with IF

Recommended Posts

Guest piermarioriva

Sorry for my English!I have a problem with IF condition.I have a variable (L:hdcrs, number) and :if (L:hd, number) < 0 then (L:hd, number)=(L:hdcrs, number)+2*piif (L:hd, number) > (2*pi) then (L:hd, number)=(L:hdcrs, number)-2*piif (L:hd, number) is greater 0 but less of (2*pi) (L:hd, number)=(L:hdcrs, number)Please me a solution!Thank Piermario

Share this post


Link to post
Share on other sites

(L:hd, number) 0 < if{ (L:hdcrs, number) 6.283185 + (>L:hd, number) } els{ (L:hd, number) 6.283185 > if{ (L:hdcrs, number) 6.283185 - (>L:hd, number) } els{ (L:hd, number) (>L:hd, number) } }you may want to change units from number to enum. IIRC numbers = whole numbers, enum = numbers and decimal.Little rusty, but that should do it, hope it helps. Regards,Roman


20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

Share this post


Link to post
Share on other sites

Hi,A basic solution (simple if/else code) :(L:hd, number) 0 < if{ (L:hdcrs, number) 2 pi * + (>L:hd, number) }els{ (L:hd, number) 2 pi * > if{ (L:hdcrs, number) 2 pi * - (>L:hd, number) } els{ (L:hd, number) 0 > (L:hd, number) 2 pi * < and if{ (L:hdcrs, number) (>L:hd, number) } } }Tom

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...