12-22-2011 06:33 AM
I'm having trouble finding anything in the help about using a "<0" or ">0" in a case statement- and when I try to type it into the cases it turns red and errors. I know I can do "0.." or "..0" but that includes zero in that frame...
Story is, I have a value coming in, if it's negative I need to load fileA.txt, if positive, load fileB.txt, if it's zero (would be default case) it does something else. I know there's gotta be a simple way of doing this, I havent finished my coffee yet and maybe I'm bein too quick to post here (but im way behind )... in the mean time I might just do 3 different case statements haha...
thx
-pat
12-22-2011 07:13 AM
First, case statements only handle integers. If your input is a float or double, you need to compare before the case. If you have integers, the solution is fairly easy. For <0 use "..-1". For >0 use "1..".
12-22-2011 07:53 AM
You could also simply use the Sign function. NOTE, however, that you might have problems with it determining whether a number is really zero due to the way floating point numbers are stored in computers.
12-22-2011 08:21 AM
Good info! Thanks you very much!
kudos
-pat