Post Reply 
REPEAT INPUT UNTIL...
03-20-2015, 12:18 PM
Post: #3
RE: REPEAT INPUT UNTIL...
(03-20-2015 12:06 PM)Didier Lachieze Wrote:  This doesn't help to show the error message contextually when the value in entered but it avoids resetting all values to the default.

thanks a lot, Didier!
So it works better, also if the errors are not contextual...

my version, after your...
Code:

EXPORT chi2_variance()
BEGIN
local a:=0.05 ,n:=2,  s:=1, si:=1, XT, chi, p;
...
local control:=1;
REPEAT
INPUT({a, n, s, si}, "Chi-square Variance test", {"Signif. level α=", "Sample size n=", "Sample var s²=", "Popul. var σ₀²="}, 
{"Significance level α (default 0.05)", "Sample size", "Observed Sample Variance  s²", "Population Variation σ₀²"},{0.01, 2, 1, 1}, {a, n,  s, si});
CASE
IF (a <=0 OR a>= 1) THEN MSGBOX("Significance level must be > 0 AND <1"); control:=1; a:=0.05; END;
IF (n<2) THEN MSGBOX("Sample numerosity must be >=2"); control:=1; n:=2; END;
IF (s<0) THEN MSGBOX("Sample Variance must be >= 0"); control:=1; s:=1; END;
IF (si<=0) THEN MSGBOX("Population Variance must be > 0"); control:=1; si:=1; END;
DEFAULT control:= 0;
END; // case
UNTIL control < 1;

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
REPEAT INPUT UNTIL... - salvomic - 03-20-2015, 11:30 AM
RE: REPEAT INPUT UNTIL... - salvomic - 03-20-2015 12:18 PM



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