Used to be that when I wrote code, I expected it to faithfully follow the course that I had outlined.
B always came after A, and code blocks never jumped in line.
I remember in Visual Basic 6 that there was a fabulous command that prevented application lockup while undergoing a CPU intensive task.
It also worked great during long loops that would otherwise render the app useless until it was completed.
The command?
DoEvents
I bring this up because I sorely miss that command.
Case in point:
I have an AJAX callback to run an XBasic function that compiles a report into a PDF and then email it.
That part works great. Maybe a little too great.
The code is so happy to run that it hogs the CPU until it has completed.
Enter the lowly Message Box...
I need to inform humble user to "Please wait while your request is being processed."
I place a call to A5.msgBox.show(blah) right above the AJAX callback thinking that it will be executed first.
What happens is that the Message Box gets pushed aside until AFTER the callback has completed.
Ok, I thought... I'll also try MouseUp and MouseDown, thinking that I will beat that callback to the starting line.
Of course that did not work either.
I tried an e.javascript command within the xbasic function but that didn't work either.
The days of Synchronicity at least ensured straight-line code execution.
And there was always DoEvents to get you out of a bottleneck.
I am still trying to cajole a Message Box to appear before the callback...
B always came after A, and code blocks never jumped in line.
I remember in Visual Basic 6 that there was a fabulous command that prevented application lockup while undergoing a CPU intensive task.
It also worked great during long loops that would otherwise render the app useless until it was completed.
The command?
DoEvents
I bring this up because I sorely miss that command.
Case in point:
I have an AJAX callback to run an XBasic function that compiles a report into a PDF and then email it.
That part works great. Maybe a little too great.
The code is so happy to run that it hogs the CPU until it has completed.
Enter the lowly Message Box...
I need to inform humble user to "Please wait while your request is being processed."
I place a call to A5.msgBox.show(blah) right above the AJAX callback thinking that it will be executed first.
What happens is that the Message Box gets pushed aside until AFTER the callback has completed.
Ok, I thought... I'll also try MouseUp and MouseDown, thinking that I will beat that callback to the starting line.
Of course that did not work either.
I tried an e.javascript command within the xbasic function but that didn't work either.
The days of Synchronicity at least ensured straight-line code execution.
And there was always DoEvents to get you out of a bottleneck.
I am still trying to cajole a Message Box to appear before the callback...
Comment