Sign in to follow this  
spokes2112

Problem with IF

Recommended Posts

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
Help AVSIM continue to serve you!
Please donate today!

(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

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