EasyManuals Logo

AMX NETLINX PROGRAMMING LANGUAGE User Manual

AMX NETLINX PROGRAMMING LANGUAGE
246 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #200 background imageLoading...
Page #200 background image
NetLinx UniCode Functions
184
NetLinx Programming Language Reference Guide
All Unicode string literals must be wrapped in the _WC macro. Failing to wrap a Unicode string in the
_WC macro will result in a compiler error.
Storing a Unicode String
Unicode strings are stored in WIDECHAR arrays, similar to the way ASCII strings are stored in CHAR
arrays. To define a WIDECHAR constant or variable and initialize it using a Unicode string literal, use
the following syntax:
WIDECHAR wcMyString[] = _WC('My String')
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 operation 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. The list of Unicode compatible functions is:
 WC_COMPARE_STRING
 WC_GET_BUFFER_CHAR
 WC_GET_BUFFER_STRING
 WC_LEFT_STRING
 WC_FIND_STRING
 WC_LENGTH_STRING
 WC_LOWER_STRING
 WC_MAX_LENGTH_STRING
 WC_MID_STRING
 WC_REMOVE_STRING
 WC_RIGHT_STRING
 WC_SET_LENGTH_STRING
 WC_UPPER_STRING
The "wc" prefix is Hungarian notation for widechar. This is simply a programming
convention and is completely optional. Hungarian notation helps you better identify
your variables while you are programming and is a general recommended standard.
For more information, see Wikipedia's Hungarian Notation page.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the AMX NETLINX PROGRAMMING LANGUAGE and is the answer not in the manual?

AMX NETLINX PROGRAMMING LANGUAGE Specifications

General IconGeneral
BrandAMX
ModelNETLINX PROGRAMMING LANGUAGE
CategorySoftware
LanguageEnglish

Related product manuals