VARCHAR data type is similar to the CHAR data type and is also used to store character strings. The size of the VARCHAR variable is limited by 65534 characters. You can declare the maximum size of a VARCHAR variable by using (size) parameter. A string stored in this variable can be shorter that the declared size, but it cannot be longer. If you do not specify the size explicitly, the default size will be used which is equal to 1.
The size parameter of VARCHAR data type indicates the storage that will be reserved in the system for the variable declared as a VARCHAR. The reserved VARCHAR declaration does not affect the behavior of the 4GL syntax, but it may affect the behavior of a database which contains a column declared as VARCHAR.
VARCHAR values are compared in the same way as CHAR values, spaces are added to the end of the shorter value until both values are equal in lengths. A VARCHAR value can be compared only with a CHAR, VARCHAR or STRING value. If a VARCHAR variable consists only of white spaces, the trim() function or the CLIPPED operator applied to it will change its value to NULL.
There are some other features that differentiate VARCHAR data type from the CHAR data type:
No trailing blank spaces are ever stripped of a VARCHAR variable or of a value entered into a database column of the VARCHAR data type, if they are entered by a user
No blank spaces are added to the end of the VARCHAR values to fit the declared size, if they are not added by the user explicitly, so there is no need to use the CLIPPED operator when working with this data type