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 Dynamicallyelsefield_ptr.IsMultiLine = FALSE;field_ptr.FocusBehavior = FT_TABTO;if columnlength < 5 thencolumnlength = 5;endif;endif;endif;If the data type is integer, float, date, or money, the preceding code ignoresthe column length returned by the select statement and assigns a lengthexplicitly. Column length is set explicitly for non-character columns becausethe column length returned by the select statement identifies the number ofbytes used by Ingres to store the data internally. Because the DynamicFrameframe requires the column length to define the width of the field on the form,it explicitly assigns column length values to these data types. (Alternatively,the CharsPerLine attribute of EntryField objects can be used to define the widthof the field.)In addition to assigning the column length for each non-character data type,the Go operation assigns the appropriate values for the DataType,FormatString, and IsMultiLine attributes of the EntryField objects.If the value in the columndatatype variable indicates that the column has acharacter data type (char, varchar, c, or text), the preceding code sets thefield's data type to varchar. The SQL ascii function converts the integer valuein the columnlength variable to a character string.In addition, character columns that are longer than 50 characters areformatted as multiline fields, and a maximum field height and length isenforced. Scroll bars are enabled for columns that require more than four 50-character lines to display.After the Go operation constructs each field, it sets relevant attributes andattaches the field to the form. The example code sets each entry field's widthequal to the value of the columnlength variable multiplied by the width of onecharacter. The height of each entry field is set to the height of one charactertimes the fieldheight variable. The outline width of each field is set using theLW_VERYTHIN constant.Creating a Frame at Runtime 409

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

Saved successfully!

Ooh no, something went wrong!