1. Optimized typ
- Posted by Jean Hendrickx <jean.hendrickx at EURONET.BE> Jul 20, 1997
- 629 views
The 07/18/97 Lucius L Hilley III <luciuslhilleyiii at JUNO.COM> wrote : Subject: Re: Optimized Type Check . ----SNIP---- procedure test_run2(number_as_string2 test_value) --printf(1, "\n%s passed.\n", {test_value}) test_value = test_value end procedure ----SNIP----- . I don't understand the utility of " test_value=test_value ". It makes the function number_as_string2 to be done twice. Is it necessary ? ... Otherwise a big routine ! Aoh! another question : how can I avoid or recover the error message in case of a bad entry ? Thank you for any help. Regards, Jean Hendrickx - jean.hendrickx at infoboard.be
2. Re: Optimized typ
- Posted by Lucius L Hilley III <luciuslhilleyiii at JUNO.COM> Jul 20, 1997
- 627 views
On Sun, 20 Jul 1997 15:01:59 +0100 Jean Hendrickx <jean.hendrickx at EURONET.BE> writes: > >The 07/18/97 Lucius L Hilley III <luciuslhilleyiii at JUNO.COM> wrote : >Subject: Re: Optimized Type Check >. >----SNIP---- >procedure test_run2(number_as_string2 test_value) > --printf(1, "\n%s passed.\n", {test_value}) > test_value = test_value >end procedure >----SNIP----- >. >I don't understand the utility of " test_value=test_value ". I set test_value = to itself as a dummy argument. It is not necessary. >It makes the function number_as_string2 to be done twice. >Is it necessary ? ... Otherwise a big routine ! >Aoh! another question : how can I avoid or recover >the error message in case of a bad entry ? Got me !!! I didn't create Euphoria. >Thank you for any help. >Regards, >Jean Hendrickx - jean.hendrickx at infoboard.be >
3. Re: Optimized typ
- Posted by Ad Rienks <Ad_Rienks at COMPUSERVE.COM> Jul 20, 1997
- 642 views
You wrote: >>Aoh! another question : how can I avoid or recover >the error >message in case of a bad entry ? >Got me !!! I didn't create Euphoria. >>Thank you for any help. >Regards, >Jean Hendrickx - >jean.hendrickx at infoboard.be > = I think it is quite easy. Instead of the 'type check', that aborts with a= n error message in ex.err, you should make it a function, that returns (for= instance) -1 when there is an error in the input. Put this function in a while loop: function check_for_error(object input) -- code goes here: -- if error in input then -- return -1 (BAD) -- else -- return 1 (GOOD) -- end if end function -- check_for_error -- main routine ------------------------------- integer error error =3D -1 while error =3D -1 do -- get input -- check_for_error(input) -- if error =3D -1 then -- error handling routine(s) -- end if end while -- loop will be left with valid input Hope this helps Sincerely, Ad Rienks writing at 23:37 , = on zondag 20 juli 1997 Using EMail Assist for WinCIM