![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 7 of 7 total |
![]() |
Mon, Jul 27 2015 6:31 AM | Permanent Link |
squiffy Telemix Ltd. | If I have some code after the ShowMessage, the show message doesn't show. It's not a killer but it does make debugging a bit hard not knowing if the routine was just not called or whether I have a bug. Coupled with my other topic on Log not seeming to work I feel the force is against me this morning
![]() Example 1 - In this example the ShowMessage fires as expected : procedure TFrmPickADate.buildCalendar; var iRow, iCol, i,j, iStart, iDays: integer; dt: DateTime; begin ShowMessage('in build'); i:=1; end; Example 2 - in this one it doesn't show at all but the code underneath executes fine : procedure TFrmPickADate.buildCalendar; var iRow, iCol, i,j, iStart, iDays: integer; dt: DateTime; begin ShowMessage('in build'); i:=1; for iRow:=0 to 5 do for iCol:=0 to 6 do Grid1.Rows.Row[iRow].Value[iCol]:='X'; // X is just for debug to show code working. Change to '' end; |
Mon, Jul 27 2015 6:46 AM | Permanent Link |
Rick | On 27/07/15 20:31, squiffy wrote:
> If I have some code after the ShowMessage, the show message doesn't show. It's not a killer but it does make debugging a bit hard not knowing if the routine was just not called or whether I have a bug. Coupled with my other topic on Log not seeming to work I feel the force is against me this morning ![]() > > in this one it doesn't show at all but the code underneath executes fine : > > procedure TFrmPickADate.buildCalendar; > var > iRow, iCol, i,j, iStart, iDays: integer; > dt: DateTime; > > begin > ShowMessage('in build'); > i:=1; > for iRow:=0 to 5 do > for iCol:=0 to 6 do > Grid1.Rows.Row[iRow].Value[iCol]:='X'; // X is just for debug to show code working. Change to '' > end; > The Javascript UI can be thought of as single threaded so any code immediately following the ShowMessage will be executed before the modal dialog is shown. I solved this issue by using the InterfaceManager.Scheduler capability as follows: procedure ....OnClick; begin ShowProgress('Building'); InterfaceManager.Scheduler.AddTask(add)' end; procedure ....add; var i: integer; begin for i:=0 to 100 do begin <process> end; HideProgress; InterfaceManager.Scheduler.TaskComplete; end; ShowProgress displays a nice progress dialog and HideProgress removes it. Make sure that TaskComplete is called after the process is done. This works but you will probably notice that the progress animated image doesn't turn like it's supposed to because once again the UI isn't being updated during long running code. I resolved this by using further TaskAdd calls within the process to allow the UI some update time. -- Rick |
Mon, Jul 27 2015 6:55 AM | Permanent Link |
squiffy Telemix Ltd. | Thanks Rick. Noted.
Though the docs do say that the ShowMessage displays a modal box - I assumed this to mean execution stopped at that point - "The ShowMessage procedure shows a simple modal message dialog. The Msg parameter indicates the message to show." This is why I hate the web ![]() |
Mon, Jul 27 2015 4:43 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | << Though the docs do say that the ShowMessage displays a modal box - I assumed this to mean execution stopped at that point - >>
No, that's not the definition of modal: "In user interface design, a modal window is a graphical control element subordinate to an application's main window which creates a mode where the main window can't be used." https://en.wikipedia.org/wiki/Modal_window Tim Young Elevate Software www.elevatesoft.com |
Mon, Jul 27 2015 5:01 PM | Permanent Link |
squiffy Telemix Ltd. | I've always, in my head, associated the disabling of the background with the halting of execution. Obviously I'm wrong. Thanks for clearing that up.
Age is horrible - I'm sure I used to know everything? |
Mon, Jul 27 2015 6:11 PM | Permanent Link |
Rick | On 28/07/15 07:01, squiffy wrote:
> I've always, in my head, associated the disabling of the background with the halting of execution. Obviously I'm wrong. Thanks for clearing that up. > If you want to notify the user and halt execution you can add WebDOM to the Uses and call the following: Window.Alert('my message'); No code will execute until the alert is dismissed by the user. -- Rick |
Mon, Jul 27 2015 7:10 PM | Permanent Link |
Steve Gill | << Age is horrible - I'm sure I used to know everything? >>
I think I know everything but I can't remember. ![]() = Steve |
This web page was last updated on Tuesday, November 28, 2023 at 10:08 AM | Privacy Policy![]() © 2023 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |