Post Reply 
Need Help with INPUT
03-01-2014, 07:54 PM (This post was last modified: 03-01-2014 09:17 PM by Eddie W. Shore.)
Post: #1
Need Help with INPUT
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:
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;
Visit this user's website Find all posts by this user
Quote this message in a reply
03-01-2014, 08:33 PM
Post: #2
RE: Need Help with INPUT
(03-01-2014 07:54 PM)Eddie W. Shore Wrote:  IF C==1
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;

There may be other issues, but should there not be a THEN after the C==1, similar to the rest of your code?

Cheers, Terje
Find all posts by this user
Quote this message in a reply
03-01-2014, 09:16 PM
Post: #3
RE: Need Help with INPUT
(03-01-2014 08:33 PM)Terje Vallestad Wrote:  
(03-01-2014 07:54 PM)Eddie W. Shore Wrote:  IF C==1
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;

There may be other issues, but should there not be a THEN after the C==1, similar to the rest of your code?

Cheers, Terje

Thanks - there should be. Typo on my part.
Visit this user's website Find all posts by this user
Quote this message in a reply
03-03-2014, 07:03 AM
Post: #4
RE: Need Help with INPUT
Hello,

Are you sure that the input is the issue?
It looks to me that your textout are problematic
> TEXTOUT_P(12,0,"# OF POINTS: "+STRING(S),2);
should be
TEXTOUT_P("# OF POINTS: "+STRING(S),12,0,2);

Cyrille
Find all posts by this user
Quote this message in a reply
03-11-2014, 01:55 PM
Post: #5
RE: Need Help with INPUT
Thanks Cyrille! I hope to have the complete program (and it's correct syntax) posted soon.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




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