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 DynamicallyAfter the title is constructed and attached to the form, the following codeconstructs its corresponding entry field:field_ptr = EntryField.Create();field_ptr.Name = columnname;field_ptr.IsNullable = TRUE;field_ptr.XLeft = fieldleft;field_ptr.YTop = fieldtop;The Create method returns an object of type EntryField to the referencevariable, field_ptr. The previous code sample assigns a name to the field_ptrvariable and specifies its nullability and its top left-hand starting position.The Go operation then constructs the data type for the field:fieldheight = 1;/* Check first for non-character data types. */if columndatatype = 'integer' thencolumnlength = 13;field_ptr.DataType = 'integer';field_ptr.FormatString = 'f10';field_ptr.IsMultiLine = FALSE;elseif columndatatype = 'float' thencolumnlength = 15;field_ptr.DataType = 'f8';field_ptr.FormatString = 'f12.2';field_ptr.IsMultiLine = FALSE;elseif columndatatype = 'date' thencolumnlength = 25;field_ptr.DataType = 'date';field_ptr.FormatString = 'd"Feb 3, 1901"';field_ptr.IsMultiLine = FALSE;elseif columndatatype = 'money' thencolumnlength = 15;field_ptr.DataType = 'money';field_ptr.FormatString = '"$$$,$$$,$$$.nn"';field_ptr.IsMultiLine = FALSE;else /* All character datatypes follow */field_ptr.DataType ='varchar(' + ascii(columnlength) + ')';/* See if we need a multiline entry field */if columnlength > 50 thenfield_ptr.IsMultiLine = TRUE;field_ptr.FocusBehavior =FT_TABTO; /* Default */fieldheight = columnlength / 50 + 1;columnlength = 50;if fieldheight > 4 thenfield_ptr.HasScrollBar = TRUE;fieldheight = 4;endif;408 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!