EasyManuals Logo

AMX NETLINX STUDIO V2.4 User Manual

AMX NETLINX STUDIO V2.4
200 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 #112 background imageLoading...
Page #112 background image
Programming
100
NetLinx Studio (v2.4 or higher)
Defining a Unicode String Literal
To enter Unicode characters into your program, enclose the characters in single quotes, like you
would any other string, and wrap the string literal in the Unicode macro _WC.
Example:
_WC('Your string goes here')
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
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.
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 STUDIO V2.4 and is the answer not in the manual?

AMX NETLINX STUDIO V2.4 Specifications

General IconGeneral
BrandAMX
ModelNETLINX STUDIO V2.4
CategorySoftware
LanguageEnglish

Related product manuals