Do Events: liveCode Equivalent

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Do Events: liveCode Equivalent

Post by townsend » Fri Oct 28, 2011 11:36 pm

I have a little trouble with database blocking.
I'll looking for the liveCode equivalent of Visual Basic's 'Do Events'.

I looked in the Dictionary under Refresh. That's not it. Nothing under Pause either.

PS: For some reason when I search this LiveCode forum,
I only gets results for 'do or events' and not for the exact phrase 'do events'.
I tried everything I could think of. Also, any forum tips for searching for an exact phrase?

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Do Events: liveCode Equivalent

Post by mwieder » Fri Oct 28, 2011 11:52 pm

What can I say... the forum software sucks.

Anyway, it's been a while since I've had to do any VB code. Can you refresh my memory about "Do Events"? Are you looking for a way to allow a process to yield time to other tasks? If so, can you insert a statement like

Code: Select all

wait for 0 milliseconds with messages
the "with messages" allows other pending tasks a chance to breathe.

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Re: Do Events: liveCode Equivalent

Post by townsend » Sat Oct 29, 2011 12:17 am

Yeah, that sounds exactly like what I'm looking for.
But it doesn't look like it redraws of the screen?
I've got an Answer dialog that gets hung up until the DB operation is complete.
It looks like this:
140 answer box.jpeg
140 answer box.jpeg (5.96 KiB) Viewed 2970 times

Code: Select all

     answer "This process will take a few minutes. Please wait..."
     set visible of button "progress" to true
     wait for 0 milliseconds with messages
     revExecuteSQL pgID, tSQL
     put the result into look
     set visible of button "progress" to false
     if  look is not 0 then
         etc...
Works fine. It just looks bad.

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Re: Do Events: liveCode Equivalent

Post by townsend » Sat Oct 29, 2011 1:16 am

Okay-- got it. Instead of using the Answer box I just created a label field, Status.
And I changed the cursor to an hour glass. Looks much better now.

Code: Select all

 put "Please wait..." into fld "status"
     set lockcursor to true
     set cursor to 1129
     wait for 0 milliseconds with messages
     revExecuteSQL pgID, tSQL
     put the result into look
     put empty into fld "status"
     set lockcursor to false
     if  look = 0 then
         etc...
Thanks Mark! That tip on...

Code: Select all

wait for 0 milliseconds with messages
is good to know about.

Post Reply