10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

How You Can Communicate with an External Program Using External User EventsBecause external events and the OpenROAD SendUserEvent method bothtrigger user event blocks, it is preferable to use appropriate namingconventions for your user events. (It cannot be determined within the eventblock whether the event was triggered by OpenROAD or by an externalprogram.)The event block for the external event can contain any OpenROAD statements.How You Can Pass an Integer Value to an Event BlockThe IIW4GL_SendUserEvent procedure, which you use in your 3GL program tosend the user event, has a messageinteger parameter that you can use to passone integer value to the user event block. In the receiving frame, OpenROADstores this value in the MessageInteger attribute of the FrameExec object. Toaccess this data in your user event block, use the CurFrame system variable toreference the current FrameExec.For more information about this procedure, see IIW4GL_SendUserEventProcedure (see page 351).How You Can Send the External User Event to OpenROADTo send the event from the external program to OpenROAD, you must write a3GL program that sends the named event to OpenROAD.This program sends the event to any running OpenROAD frames. If anOpenROAD frame has registered for that event, the associated event block istriggered. If none of the events are registered or if none of the registeredframes are running, the request is ignored.IIW4GL_SendUserEvent ProcedureOpenROAD provides the IIW4GL_SendUserEvent procedure to send the eventname and optional integer value. This procedure is described in theIIW4GL_SendUserEvent Procedure (see page 351).The IIW4GL_SendUserEvent procedure sends the event name and optionalinteger value directly to the OpenROAD application. It returns an integer statusvalue. The syntax follows:status = IIW4GL_SendUserEvent(errormsg, &sent, token,eventname, fb, msgi4)Inter-Frame Communication Techniques 351

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

Saved successfully!

Ooh no, something went wrong!