03-20-2015, 11:30 AM
In my program I've this code:
It works but non as I would like...
If there is an error, MSGBOX is showed after the whole input routine, then restart the input and this reset all variables...
There is a way to present every msgbox contextually to the error catching and then not to reset the variables without errors?
Thank you in advance
Salvo
Code:
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}, {0.05,2, 1, 1});
CASE
IF (a <=0 OR a>= 1) THEN MSGBOX("Significance level must be > 0 AND <1"); control:=1; END;
IF (n<2) THEN MSGBOX("Sample numerosity must be >=2"); control:=1; END;
IF (s<0) THEN MSGBOX("Sample Variance must be >= 0"); control:=1; END;
IF (si<=0) THEN MSGBOX("Population Variance must be > 0"); control:=1; END;
DEFAULT control:= 0;
END; // case
UNTIL control < 1;
It works but non as I would like...
If there is an error, MSGBOX is showed after the whole input routine, then restart the input and this reset all variables...
There is a way to present every msgbox contextually to the error catching and then not to reset the variables without errors?
Thank you in advance
Salvo