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 Write an AssistantFirst, the parameters are defined:Procedure Create_Dyn_Fld(fs = FrameSource not null,return_code = integer not null,batch_mode = integer not null)=Because the procedure must support batch mode, a default string is specified.Otherwise, the user is prompted for the string:if batch_mode = TRUE thentext_string.value = 'Hello, world!';elsestatus = curprocedure.replypopup(messagetext ='Enter text string.',reply = text_string);if status != PU_OK thenreturn_code = ER_FAIL;return;endif;endif;Next, a text trim field is loaded with the specified text string:trim_field = freetrim.create();trim_field.textvalue = text_string.value;Finally, the procedure must assign a value to the return code parameter andattach the composite field to the form:trim_field.ParentField = fs.topform;return_code = ER_OK;How You Can Attach the Assistant to a Frame TemplateIn the same application that contains the Create_Dyn_Fld frame assistantprocedure, a frame template can be created (for example,My_Frame_Template). To associate the frame template My_Frame_Templatewith its assistant, open the Property Inspector for the frame template in theFrame Editor, and specify Create_Dyn_Fld as the assistant procedure.When a user frame is subsequently created from the templateMy_Frame_Template, the procedure Create_Dyn_Fld is called, which populatesthe new frame's form with a trim field entered by the user.422 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!