Post Reply 
multi criteria IF statement
06-11-2021, 11:37 AM
Post: #2
RE: multi criteria IF statement
I would probably use a case statement for that task:

Code:
EXPORT Amer7scode(x,y)
BEGIN
 LOCAL n, orig;
 orig:=HAngle; 
 HAngle:=1;
 CASE
  IF y>0 AND x>0 THEN n:=ATAN(y/x) END;
  IF y>0 AND x<0 THEN n:=ATAN(y/x)+180 END;
  IF y<0 AND x<0 THEN n:=ATAN(y/x)+180 END;
  IF y<0 AND x>0 THEN n:=ATAN(y/x)+360 END;
  DEFAULT n:="error"
 END;
 HAngle:=orig;
 RETURN n;
END;

-road
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
multi criteria IF statement - Amer7 - 06-11-2021, 11:06 AM
RE: multi criteria IF statement - roadrunner - 06-11-2021 11:37 AM
RE: multi criteria IF statement - Amer7 - 06-11-2021, 11:59 AM
RE: multi criteria IF statement - Dougggg - 06-12-2021, 03:05 AM
RE: multi criteria IF statement - Joe Horn - 06-13-2021, 01:10 PM



User(s) browsing this thread: 1 Guest(s)