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 Work with Text StringsDP_SCALE_IMAGE_HWSpecifies that OpenROAD scales the height and width of the image to fitthe field, possibly causing the image to distortDP_SCALE_IMAGE_HSpecifies that OpenROAD scales the image vertically to fit the field. Theaspect ratio of the image is maintained.DP_SCALE_IMAGE_WSpecifies that OpenROAD scales the image horizontally to fit the field. Theaspect ratio of the image is maintained.How You Can Work with Text StringsThe StringObject class is an in-memory text string of any length. It providesmethods that enable you to manipulate a text by extracting, truncating, andconcatenating strings. It also provides the attributes and methods you use forstoring and updating the strings, either in standard text files or in thedatabase. The StringObject class makes it easy to build applications that letusers create, modify, and store textual data of indeterminate size.When you create a multiline entry field in OpenROAD Workbench, you canchoose between two types of variables, a varchar data type and a StringObjectdata type. When you select the StringObject data type, the variable associatedwith the entry field is a reference variable that points to an object of the classStringObject. The StringObject class is also useful for local and globalvariables, which you can use to store text or pass as parameters betweenframes or 4GL procedures.StringObject objects are very effective for storing moderately sized text.However, because all manipulation is done in dynamically allocated memory,using StringObject objects to store large text strings is not very efficient. Fortext that is always less than 2000 bytes, the varchar data type is the mostefficient format.Setting a StringObject attribute does more than change the attribute's value.Each time you change the value, OpenROAD executes implied procedures. Forexample, when you set the FileHandle attribute to a new value and theStringObject is associated with an entry field, OpenROAD displays the newstring in the field. This process simplifies your coding because all you need todo is set the attribute.The StringObject class lets you store strings either in standard text files or in adatabase. Using your native file system to store strings in standard filesprovides performance advantages. You can use SQL to store and retrieve thefile names in a database table.Working with Images and Text Strings 287

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

Saved successfully!

Ooh no, something went wrong!