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 Build a Frame DynamicallyWhen a fixed-choice list (for example, table_choices) is currently displayed,OpenROAD does not automatically refresh the display after you make changesto the option field's ValueList. You must explicitly refresh the display withChoiceField's UpdChoiceList method. The following statement from theexample application refreshes the display of the table_choices option field:field(table_choices).UpdChoiceList();How You Can Initialize VariablesAfter loading appropriate table names into the option field, the examplestarting frame initializes all variables whose values remain the samethroughout the program. The following code from the starting frame's initializeblock initializes variables:/* Set up initial values. */widthchar = 100;heightchar = 200;trimleft = 100;trimspace = 100;maxformheight = 3000;maxformwidth = 9000;fieldleft = trimleft + (33*widthchar) + trimspace;vertspace = 250;All values refer to one-thousandths of an inch.The Go Menu Item (Constructing the Frame)After selecting a table, the user selects the Go menu item. Because theexample application lets the user return to the initial frame to select anothertable, the code for the Go operation checks whether a frame already exists forthe chosen table before generating a frame for that table. If such a frameexists, it executes the frame.The following code from the example starting frame first checks whether therequired frame exists. Then it executes the frame, if it does exist, or generatesthe frame and then executes it if it does not exist:if Generated_Frame_List.LastRow >0 then/* There is at least one generated frame. */for i = 1 to Generated_Frame_List.LastRow doif Generated_Frame_List[i].table_name =table_choices then/* Frame already there. Execute it. */callframe:Generated_Frame_List[i].frame_name;resume;endif;i = i + 1;endfor;endif;402 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!