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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...