Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 27 MAY 2010 04:22:52PM Terry Rainville wrote:

How do you break a loop using the keyboard.

Program will loop until a key pressed ect…


At 27 MAY 2010 07:22PM Richard Hunt wrote:

Use the "CHAR" event to set a variable and check that variable during your loop.


At 28 MAY 2010 12:16PM Terry Rainville wrote:

Already was looking at this.

I am new to OI can you please provide an example - would make it much easier to understand.


At 28 MAY 2010 01:01PM Terry Rainville wrote:

Could you please supply and example of how to do a CHAR event.


At 31 MAY 2010 02:37PM Richard Hunt wrote:

Within a combobox, editbox, editfield, edittable or listbox put this statement in the "edit events" "char"…

RESULT=SET_PROPERTY(CTRLENTID,'@KEY_PRESSED',1)

Then within your loop check if the @KEY_PRESSED is set to 1 or…

IF SET_PROPERTY(CTRLENTID,'@KEY_PRESSED') EQ 1 THEN

The problem you will have is that somehow you will have to "yield" within your loop so that the "char" event can execute.


At 31 MAY 2010 03:10PM Richard Hunt wrote:

I set up this method of handling long LOOPing procedures so that the users do not have to sit and stare at the screen waiting for the process to complete. They can multitask if they want to, which seems to be quite popular to my customers.

Maybe you will find this useful, maybe you will not.

I use labeled common variables within a stored procedure. I set the labeled common variables within the "CREATE" event and free the labeled common variables within the "CLOSE" event. I also set up a MENU event with an accelerator key to set the abort flag.

The actual looping is handled by calling a POST_EVENT. That way other processes are allowed to share processing time. The loop actually is in three parts.

Part one, START… The start of the loop. You set the necessary variables, select the list, open files, or what ever needs to be done before the loop, and then call the NEXT part of the stored procedure using a POST_EVENT statement.

Part two, NEXT… The next iteration of the loop. Use a REMOVE statement, do a READNEXT, sequentially read from a file, or what ever needs to be done during the loop. You check for the ABORT flag to see if you should abort. If you should abort then you call the FINISH part of the stored procedure using the POST_EVENT statement. You check to see if the LOOP process is complete, if so then call the FINISH part of the stored procedure using a POST_EVENT statement. Otherwise you call the NEXT part of the stored procedure using a POST_EVENT statement. This is what causes the LOOP effect.

Part three, FINISH… Do what ever needs to be done after the LOOP is complete.

You can use the OMNIEVENT for the POST_EVENT statements and put this stored procedure in the OMNIEVENT event.

This works absolutely great for all my programs and reports that use selects, readnext, sequential reads, or any other long LOOPs.


At 02 JUN 2010 05:29PM Terry Rainville wrote:

Well I came up with a crewd but effective way that was pretty simple.

Thought I would share it here for anyone interested.

Using the MSG with the new G(gauge) option and C(Cancel Button)

Check Help MSG function for clear example of coding needed

Msgup=msg….. up message

for X=1 to 5000

wait(00H00M10S) - routine I made that just checks current time

while msg…. checks for cancel key pressed

execute statements (procedures)

next X

MsgDown=msg…. down message

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/ee7049c056e7873485257730006ff522.txt
  • Last modified: 2023/12/28 07:39
  • by 127.0.0.1