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.

How You Can Write an AssistantNote: Fields generated from a field template are completely overwritten whenthe ApplyTemplate utility is run; therefore, any changes made to the field arelost.Be aware that any changes you make to your frame or field must be made insuch a way that they are not overwritten by the ApplyTemplate utility.OpenROAD provides a mechanism whereby you can identify the areas of theframe that are designated as “user” areas—where user modifications arepreserved. The other areas belong to and are completely overwritten by theApplyTemplate utility. This involves several considerations when writing andmodifying your assistant procedure code. These concepts are discussed in thefollowing sections of this chapter.How You Can Write an AssistantIn OpenROAD, the developer can associate a 4GL procedure with a frame orfield template, which is then referred to as the template's “assistant.” Thistemplate, when combined with an assistant procedure, enables the user tocreate frames and fields that are more powerful and immediately useful thanthose created from templates alone.The following specifications for developing an assistant procedure include:• The assistant must be a 4GL procedure. The 4GL procedure itself can,however, subsequently call frames to interact with users.• The 4GL procedure has three parameters, all of which are mandatory.For frame template assistant procedures, the parameters are:fsParameter Type: FrameSourceSpecifies the instance of the frame that is currently being created ormodified by the ApplyTemplate utilityreturn_codeParameter Type: Integer (ER_OK, ER_FAIL)Specifies the return code. It is assigned the value ER_OK if the procedurecompletes successfully; otherwise, it is assigned ER_FAIL.420 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!