LB Booster
Programming >> Compatibility with LB4 >> Why no error message? http://lbb.conforums.com/index.cgi?board=compatibility&action=display&num=1429479319 Why no error message?
Post by Alincon on Apr 19th, 2015, 9:35pm
Why does this code execute with out an error message of some kind?
Code:
STATICTEXT #credit.st0, "Name", 20, 40, 50, 20
TEXTBOX #credit.tbFname, 80,40,110,25
open title$ for window as #credit
#credit, "trapclose [creditExit]"
#credit.tbFnam, "Richard" 'textbox name is mis-spelled
wait
[creditExit]
close #credit
end
Re: Why no error message?
Post by Richard Russell on Apr 19th, 2015, 10:10pm
Why does this code execute with out an error message of some kind?
LBB can't report an error at compile-time, because it's possible the 'mis-spelled' handle is created at run time using MAPHANDLE, so is actually correct.
It would be possible to report an error at run-time, but LBB generally does relatively little run-time error checking, principally to improve performance (checking that the handle is valid would take time).
It's a difficult balancing act. Is it better to impair performance every time the program is run in order to catch an error during program development? I suppose, in principle, one could have two different run-time engines - one used during development with lots of error checking and another used for the final version with the error checking omitted.
If you feel this is a case when I've made the wrong call I can consider adding a run-time check in the next release (if there is one!).
Richard.
Re: Why no error message?
Post by RNBW on Apr 19th, 2015, 10:39pm
Just an observation: although it doesn't actually report an error, it doesn't print "Richard" in the textbox. If you were expecting text in the textbox, it would tell you something was wrong whilst debugging.
Ray
Re: Why no error message?
Post by Alincon on Apr 20th, 2015, 01:46am
Richard, I just wanted to know why no message, and your explanation is reasonable. Certainly don't need two run-time engines. The next time, I'll know where to look.