Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 10 OCT 2021 05:49:53PM cmeyer wrote:

I have a looping routine that imports excel spread sheets. Within the loop there is a MSG that displays the excel file name being imported MsgUp = MSG(@window,'Collecting excel data from ':filename). Put up the MSG, Get excel data, put down the MSG. After about the fourth spread sheet, the message being displayed is all white without any details, just a heading saying (Not responding).

How can I get the messages to display correcly.

Any advice would be grateful.

Chris


At 10 OCT 2021 07:00PM Barry Stevens wrote:

I have a looping routine that imports excel spread sheets. Within the loop there is a MSG that displays the excel file name being imported MsgUp = MSG(@window,'Collecting excel data from ':filename). Put up the MSG, Get excel data, put down the MSG. After about the fourth spread sheet, the message being displayed is all white without any details, just a heading saying (Not responding).

How can I get the messages to display correcly.

Any advice would be grateful.

Chris

Does the spreadsheet eventually get processed?

Can you put a Yield() in maybe the heavy lifting part of the spreadsheet processing


At 10 OCT 2021 11:32PM cmeyer wrote:

Thanks Barry, that seems to have fixed the problem.


At 13 OCT 2021 12:13PM Carl Pates wrote:

Hi Chris,

If you want to know the details of what is actually happening you can read about it in this article.

Regards

Carl Pates


At 13 OCT 2021 03:56PM Barry Stevens wrote:

Hi Chris,

If you want to know the details of what is actually happening you can read about it in this article.

Regards

Carl Pates

@CarlPates

In OI10, is Yield(1) an implied replacement for 'Safe Yield'

What is the rule of thumb in using 'safe yield Yield(1)' as opposed to Yield(). Overhead assumed.

if you are in a loop readnext using @id & @record and you have yield() are you saying that @id & @record could be compromised?

-b


At 13 OCT 2021 07:50PM cmeyer wrote:

Hi Carl,

Should I change ALL the OI9.4.6 occurences of Yield() to Yield(1) so that following the next migration OI10 has the correct version.

Chris


At 13 OCT 2021 08:55PM Barry Stevens wrote:

Hi Carl,

Should I change ALL the OI9.4.6 occurences of Yield() to Yield(1) so that following the next migration OI10 has the correct version.

Chris

IMHO no need if you were able to use yield() with no issues


At 13 OCT 2021 11:51PM cmeyer wrote:

I thought Carl was indicating there may be a performance issue in OI10 if you don't use Yield(1).

All I am asking if there is a problem changing Yield() to Yield(1) in Oi9.4.6 preparing for my next migration.

Chris.


At 14 OCT 2021 04:26AM Carl Pates wrote:

Hi Chris,

No.

Yield() tells OI to stop what it's doing and process any queued events instead. Those events could be doing _anything_. If one of those events changes a global variable like @ID, @DICT etc, then it could affect code elsewhere, because, well, it's global.

So, when you call Yield() you look at the context in which you are calling it from. If you're in the middle of a select process where you have an active cursor that is going to use global variables (which it will) then yes, you use the "safe" option. If this is not the case then you use the standard version.

Using the "safe" version will add overhead, because it's saving and restoring several global variables on each iteration, so don't use it unless you need it. If the safe option was needed all the time then we'd just make it the default, but that is not the case.

Using the normal version:

   Call MyFunctionToDoStuff()



   Loop

   Until MyStuffIsDone()

      Call Yield() ; // Don't care - we're just spinning our wheels...

   Repeat

Using the safe version:

   $Insert Rlist_Equates

   $Insert Logical



   Eof = FALSE$

   Call RList( "SELECT ALLTHETHINGS", TARGET_ACTIVELIST$, "", "", "" )



   Loop

      ReadNext @ID Else Eof = TRUE$

   Until Eof

       Call DoSomethingWithThis( @ID )

       Call Yield( TRUE$ ) ; // Safe version - we're in the middle of an active cursor

   Repeat

Regards,

Carl Pates

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/7714e3148ac34e4e9041a2d65a3b60df.txt
  • Last modified: 2024/01/04 20:57
  • by 127.0.0.1