03-01-2014, 07:54 PM
I keep getting Error: Invalid Input and I don't get where the error is or what causes it. Does INPUT not work within loops? Any help is greatly appreciated.
Program:
Program:
Code:
EXPORT EXPSMTH()
BEGIN
LOCAL X,A,M,D,S,P;
LOCAL K,C,L1,L2;
// L1: Actual Data, L2: Predictive Data
// Initialize
INPUT({X,A},"INITIALIZE",{"DATA:","ALPHA:"});
L1:={X}; L2:={X}; S:=S+1;
REPEAT
CHOOSE(C, "OPTIONS", "Add Point", "Delete Last Point", "Quit");
IF C==1 THEN
INPUT(X, "NEXT POINT"); // This is where the error points to. Can't INPUT work with globalize variables?
L1:=CONCAT(L1, {X});
S:=S+1;
END;
IF C==2 THEN
L1:=SUB(L1,1,S);
S:=S-1;
END;
RECT();
TEXTOUT_P(12,0,"# OF POINTS: "+STRING(S),2);
IF S>1 THEN
P:=L2(1);
FOR K FROM 2 TO S DO
P:=P+(L2(K)-L1(K))*A;
END;
TEXTOUT_P(60,0,"ALPHA: "+STRING(A),2);
TEXTOUT_P(72,0,"PREDICTION: "+STRING(P),2);
END;
WAIT(-1);
UNTIL C ==0 OR C==3;
END;