The type conversion operator creates a property that converts an object of one built-in class to an object of another built-in class. If type conversion is not possible, the property value will be
String and file types
String types can be converted to human-readable file types (
HTMLFILE, etc.), and vice versa - human-readable file types can be converted to string types.
Converting dynamic-type files (
FILE) to strings and vice versa is prohibited in the current implementation, but if necessary this can be done via an intermediate human-readable type - for example, by first converting to
CSVFILE, and only then to
FILE (the resulting file will have the extension CSV)
To implement conversion, the type conversion operator is used.
itemCount = DATA INTEGER (Store);
itemCountToString(s) = BPSTRING(itemCount(s));
barcode = DATA STRING (Item);
longBarcode(Item i) = LONG(barcode(i));