To meet your needs, we constantly work to improve Querix products.
This means that Lycia documentation is developing as well.
In case you have found a certain dissonance between the provided information and the actual behavior of Lycia 3 and/or your applications, please, let us know about this via documentation@querix.com so that we can introduce the necessary changes to our documentation.
Thank you for your attention and cooperation.
Any digital data can be stored in a BYTE data type. The BYTE data type stores information unstructured, these can be program modules, pictures, sounds and any other information that can be stored in digital form.
You can use the LIKE keyword within the DEFINE statement to define a variable like a database column of the BYTE data type.
The value of BYTE type is limited to 2 gigabytes, but it can also be limited by the storage capacity of your system.
A variable of this data type can be used:
In operations with database columns of BYTE data type
To reference a file you need to use in your program
After a variable of BYTE data type has been declared, it is necessary to use 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.
You can use these methods to manipulate variables of BYTE data type:
§ readFile() - reads data from the specified file and passes it to the memory or to the variable of a large data type indicated by the LOCATE statement,
§ writeFile() - writes data from the variable (source file or memory) to the specified file.
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.