In a Unicode application, i.e., when FW_SetUnicode( .t. ) is set, GET of a character variable can be defined in three ways.
Code: Select all
1) @ r,c GET .... CHRGROUP CHR_ANSI
2) @ r,c GET .... CHRGROUP CHR_ANY // This is default if CHRGROUP clause is not used.
3) @ r,c GET .... CHRGROUP CHR_WIDE
Case (1): CHR_ANSI
In this case, the user interface is handled by FWH and Harbour. The behaviour is exactly the same we were used to for years. We can use all picture clauses but the Get object accepts ANSI characters only. Unicode input is not allowed.
Case (2) and (3):
The user-interface is totally managed by Windows Edit control. Unicode characters are allowed.
Only picture clause allowed is "@!". Any other picture clause is ignored.
This user interface is different from the Case-1 that we were used to with FWH for years, but this is the standard user interface of Windows Edit control.
Difference between Case(2) and (3):
Case (2): CHR_ANY ( default )
The user input is restricted to the number of bytes in the length of the variable used.
If Len( cVar ) is 12, either 12 ANSI characters are allowed of 4 UTF8 characters are allowed.
Case (3):
The user input is restricted to the number of characters in the variable.
If the initial value of the variable is "ABCD", the byte-length is 4. But the user can enter 4 unicode characters. In that case the result string will be 12 byte long.