Including The Unicode Library; Unicode Characters; Working With Widechar Arrays And Unicode Strings - AMX NetLinx Studio Instruction Manual

Netlinx design v3.3 or higher
Table of Contents

Advertisement

Including the Unicode Library

The Unicode Library is implemented in a NetLinx Include file, UnicodeLib.axi, that must be included in your program
in order to access the Unicode functions.
The Unicode Library is in an Include file located in the C:\Program Files\Common Files\AMXShare\AXIs directory.
Because this location is the default Include search path, you do not need to specify the directory in the include statement.
To include the Unicode Library to your program add these lines to your program:
(***********************************************************)
(*
(***********************************************************)
#INCLUDE 'UnicodeLib.axi'

Unicode Characters

To insert unicode characters into the active Source Code file, at the cursor's position:
1.
Select Unicode Edit from the Edit menu or the Editor window Context Menu to access the Enter Text dialog
(FIG. 175).
FIG. 175
Enter Text dialog (Unicode text)
2.
Type one or more characters in the upper text box to display the characters' unicode send command value in the
lower (read-only) window.
3.
Press OK to insert the unicode send command value in the code, at the cursor's position.

Working with WIDECHAR Arrays and Unicode Strings

Working with WIDECHAR arrays and Unicode strings is very similar to working with CHAR arrays and ASCII strings.
Most operations that can be performed on a CHAR array can be performed on a WIDECHAR array.
For instance, to assign a string to a variable use this syntax:
wcMyString = _WC('My String')
The string functions defined for CHAR arrays have been defined for WIDECHAR array for use in Unicode programming.
These functions allow you to operate on strings similar to the way you would with CHAR array. For instance, to remove
the first 3 characters from a WIDECHAR array and return those characters as a WIDECHAR array, use
WC_GET_BUFFER_STRING:
wcRemoved = WC_GET_BUFFER_STRING(wcMyString,3)
You will find that most other function work exactly as their CHAR counterpart do except they work on and return
WIDECHAR arrays.
NetLinx Studio - Instruction Manual
INCLUDE FILES GO BELOW
Programming
*)
99

Advertisement

Table of Contents
loading

Table of Contents