The BYTE data type can store any binary data - large objects like program modules, pictures, sounds, and any other information that can be stored in digital form.
The value of BYTE type is limited to 2 gigabytes, but it can also be limited by the storage capacity of your system.
Default value: NULL. To change this behaviour, use QX_INITVAR.
A variable of this data type can be used:
You can use the LIKE keyword within the DEFINE statement to define a variable like a database column of the BYTE data type.
After you declare the variable of the BYTE data type, use the LOCATE statement to tell the program where the information for this variable is located. A column defined as BYTE type can be assigned to a BYTE variable completely or partially. If you want to assign only a part of the contents of the column to a BYTE variable, you’ll need to specify the beginning and the end of the part you want to assign in bytes using square brackets as delimiters – variable [m, n]. E.g.:
SELECT image1 [1,100] INTO my_pic FROM catalogue
Here m and n are the coordinates of the first byte of a picture from which the part you want to assign begins and the last byte of the piece. The above code will select first 100 bytes of the specified picture image1 into my_pic variable.
There are a number of restrictions that should be kept in mind while using BYTE data type:
Only IS NULL and NOT NULL operators can be used with variables of this type.
The following statements cannot be used with BYTE values: DISPLAY, PRINT, LET, INITIALIZE. (The later to statements cannot assign a value to a BYTE variable other than NULL)
BYTE arguments can be passed by reference using CALL and OUTPUT TO REPORT statements, but they cannot be passed by value.
A form field assigned to a database column of BYTE data type or a formonly field of BYTE data type will display the BYTE value, if this value is an image of any type - a so called BLOB. If the BYTE value is some data which cannot be represented graphically, the BYTE field will remain empty.
BYTE values can be edited by means of the PROGRAM attribute.
A form field of BYTE type can have no other attributes except COLOR and PROGRAM.