New topic: WE what is the real order of code execution ???
<http://forums.realsoftware.com/viewtopic.php?t=47889> Page 1 of 1 [ 4 posts ] Previous topic | Next topic Author Message gecomail Post subject: WE what is the real order of code execution ???Posted: Wed May 15, 2013 6:49 pm Joined: Tue Oct 25, 2011 4:28 am Posts: 45 I have put in webCommandButton this code : webProgressBar1.visible=true subProcPopulateMysqlTable webProgressBar1.visibile=false if i click this button the webProgressBar1 stay always invisible but subProcPopulateMySqlTable employs 10 seconds to execute his code... why webProgressBar not become visible and at finish of execution of subProc become invisible ??? can anyone help me ?? tnx Top edb Post subject: Re: WE what is the real order of code execution ???Posted: Wed May 15, 2013 10:34 pm Joined: Sun Dec 10, 2006 7:57 am Posts: 118 Location: Addison, Texas You need to put a condition to check whether subProcPopulateMysqlTable finished before setting webProgressBar1.visible to false. The code you have now won't show the Progressbar, because it's running sequentially within a few microseconds... and the last statement is setting the visibility before it has a chance to become from the first statement. _________________ Respectfully, Eric Brown http://www.facebook.com/ericdbrown Top timhare Post subject: Re: WE what is the real order of code execution ???Posted: Thu May 16, 2013 12:00 am Joined: Fri Jan 06, 2006 3:21 pm Posts: 12322 Location: Portland, OR USA When you push a WebButton, the display state isn't pushed to the client until the entire event completes. You need to break your code up into 2 pieces. 1) Set the progressbar visible and start a short-period timer. 2) In the timer, run the sql procedure and then set the progressbar invisible. Top gecomail Post subject: Re: WE what is the real order of code execution ???Posted: Thu May 16, 2013 2:11 am Joined: Tue Oct 25, 2011 4:28 am Posts: 45 excuse me but this is a big problem.... if i have a sub that insert 5000 records (subInsertRecords) and this sub employ 50 seconds to be executed, 100 records at second. Then i have another sub that delete all record from the same table (subDelRecords) and this employ 5 seconds to be executed. if i have a webButton with this code ...subInsertRecords ...subDelRecords the result will be that the table is not clear but that the subDelRecords delete only 500 records ??? i hope that we not work in this mode .... Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 4 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
