MsgBox being a bit odd . . .

Want to talk about something that isn't covered by another category?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

MsgBox being a bit odd . . .

Post by richmond62 » Thu Aug 04, 2022 2:43 pm

SShot 2022-08-04 at 16.32.54.png
-
Has this script in the button:

Code: Select all

on mouseUp
   put 1 into QS1
   repeat until QS1 > 9
      put 1 into QS2
      repeat until QS2 > 9
         put QS1 & "," & QS2 into fld "ff"
         put QS1 & "," & QS2
         wait 15 ticks
         add 1 to QS2
      end repeat
      add 1 to QS1
   end repeat
end mouseUp
Which is extremely pedestrian, and should deliver QS1 "," QS3 in the messageBox simultaneously to delivering
it into the field, but that does NOT happen: the messageBox stays empty until both the repeat cycles have finished,
then all the numbers cycle in the messageBox extremely quickly . . .

AND that is only visible IF the user opens the messageBox before hitting the button: otherwise the messageBox
appear at the end of the whole process with 9,9.

MacOS 13 public beta 2
LiveCode 9.6.3, 9.6.8, 10 DP 4

It works PERFECTLY (as expected) in LiveCode 8.2.0 DP2
Attachments
Roll Over.livecode.zip
Stack.
(9.43 KiB) Downloaded 60 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: MsgBox being a bit odd . . .

Post by richmond62 » Thu Aug 04, 2022 2:44 pm

This is a real pain in the bum for checking any sort of loop.

bobcole
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 133
Joined: Tue Feb 23, 2010 10:53 pm
Location: Saint Louis, Missouri USA

Re: MsgBox being a bit odd . . .

Post by bobcole » Thu Aug 04, 2022 4:16 pm

Try adding "with messages" to the wait command:

Code: Select all

wait 15 ticks with messages
That works for me.
Bob

LiveCode 1.0.0-dp-3
MacBook Pro (M1 Arm)
macOS 12.5 (Monterey)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: MsgBox being a bit odd . . .

Post by richmond62 » Thu Aug 04, 2022 5:04 pm

That works for me.
It probably does, but that should not be necessary.

(A nice glass of whisky works for me, but it is not necessary.) 8)

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: MsgBox being a bit odd . . .

Post by jacque » Thu Aug 04, 2022 5:30 pm

Loops do not yield to the engine unless you tell them to, so redraws don't happen without specific instructions. If it were otherwise, repeat loops would be even slower than they are now.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: MsgBox being a bit odd . . .

Post by richmond62 » Thu Aug 04, 2022 5:41 pm

I wonder why everything behaves 'as it should' in LC 8.2.0 DP 2, and not in LC 9.6.3 and upwards?

Oh, and before you ask: LC 8.2.0 DP2 runs without a hitch on MacOS 13 public beta 2.
Last edited by richmond62 on Thu Aug 04, 2022 5:43 pm, edited 1 time in total.

stam
Posts: 2634
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: MsgBox being a bit odd . . .

Post by stam » Thu Aug 04, 2022 5:42 pm

Yes I think even

Code: Select all

Wait 0 with messages
works, and for the reason Jacque says… the “with messages” bit gives the engine a look-in to update the interface etc. essential if you want to be able to cancel a long loop using a button etc.

stam
Posts: 2634
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: MsgBox being a bit odd . . .

Post by stam » Thu Aug 04, 2022 5:44 pm

richmond62 wrote:
Thu Aug 04, 2022 5:41 pm
I wonder why everything behaves 'as it should' in LC 8.2.0 DP 2, and not in LC 9.6.3 and upwards?
Just guessing but it’s probably due to a effort to optimise loop performance.

Post Reply

Return to “Off-Topic”