Hi,
I'm new to basic4ppc and I'm writing my first application.
I have a fom with some textboxes and I'm writing a validation routine on the 'lostfocus' event of the first textbox. It looks to me that the next control (also a textbox) gets the focus before my validation routine has ended. It looks even to me that the validation routine is interupted to execute the code on the getfocus of the next textbox.
Is this correct?
Also, in my validation routine, when the input is invalid, I'm sending a msgbox, with as result that the lostfocus event of the 2nd textbox gets fired too.
Running this in debug mode (step by step) to find out the sequence of the events, does not seem that easy, because (obviously) the gotfocus/lostfocus events happen at every step...:BangHead:
I could add some tests in my code to get rid of my problems but I wonder :
- if this is good practice to write a validation routine on the lostfocus event?
- if there exist some guidelines with 'best practices' including some do's and don'ts?
- if I should (always ?) use the formlib library and use other events? Which ones?
Many thanks for your help.