10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Event-based <strong>Programming</strong>Note: The form associated with each frame (CurFrame.TopForm) contains onlynon-menu fields. Menu fields are separate from the form because they aretoolkit-specific. Therefore, menu events do not trigger corresponding childevents for the frame. There are no child events for a menu stack or for themenu as a whole.How You Can Interrupt an Event BlockTypically, OpenROAD finishes executing the current event block before movingon to the next event in the queue. However, you can use the resumestatement to interrupt the current event block. Statements following theresume statement are not executed.In the following sample frame script, the resume statement is used to interruptthe event block if the user decides to not delete the videos. Otherwise, theprocessing continues.on cleartable checkout_form.checkout =beginstatus = CurFrame.ConfirmPopup(messagetext ='You are going to delete all checked out videos' +' for this customer.');if status != PU_OK thenresume;endif;/* We will delete the rows in reverse order to play it** safe */i = checkout_form.checkout.LastRow;while i > 0 do/* This does not actually delete the row, but tags** it with a rowstate of RS_DELETED. */checkout_form.checkout.SetRowDeleted(rownumber = i);i = i - 1;endwhile;field(checkout_form.checkout).HasDataChanged = TRUE;endBecause the resume statement terminates the current operation, it is usuallythe last statement either in the event block or in the statement list of the ifstatement (as shown in the previous example).328 <strong>Programming</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!