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 DynamicallyNote: The table iidbconstants is a view in the Ingres Standard CatalogInterface that has two columns. One column holds the name of the currentuser and the other holds the name of the DBA of the current database.Before loading the table names selected at runtime into the option field, thestarting frame clears any previous values from the option field. This step isnecessary because you must give a value to the option field when you create itin OpenROAD Workbench. The following statement clears the option field in theexample frame:field(table_choices).ValueList.ChoiceItems.Clear();ValueList is the attribute of the OptionField class that contains the values thatappear in the list. Its data type is ChoiceList. One attribute of ChoiceList isChoiceItems, which is an array of class ChoiceItem. It is the ChoiceItems arraythat actually contains the values displayed in the option field. For a moredetailed explanation of loading values into the option field, see How You CanLoad Values into a ChoiceField Object (see page 401).After clearing the option field of values, the starting frame uses a select loop toretrieve the new values to be loaded into the option field. The retrieved valuesare the names of all the tables that are owned by the DBA. The table namesare retrieved from iitables (an Ingres Standard Catalog Interface view). Theselected tables are returned one at a time and processed by the select loop.The select loop places each table name into the option field's ValueList.The following code is an example of the select loop discussed in the previousparagraph:i = 1;select distinct table_name as :tmp_table_namefrom iitableswhere table_owner = :dbanamebeginfield(table_choices).ValueList.ChoiceItems[i]EnumText = tmp_table_name;field(table_choices).ValueList.ChoiceItems[i]EnumValue = i;i = i + 1;end;The following section, How You Can Load Values into a ChoiceField Object (seepage 401), explains the syntax used to load values into the table_choicesoption field.400 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!