
NetLinx UniCode Functions
179
NetLinx Programming Language Reference Guide
NetLinx UniCode Functions (Cont.)
WC_GET_BUFFER_CHAR
This keyword removes a character from a buffer.
WIDECHAR WC_GET_BUFFER_CHAR (WIDECHAR A[])
The result is a WIDECHAR value.
WC_GET_BUFFER_CHAR has a two-part operation:
1. Retrieve the first character in the buffer.
2. Remove the retrieved character from the buffer and shift the remaining char-
acters by one to fill the gap.
wchChar = GET_BUFFER_STRING(wcString)
// wchChar contains first character of wcString
// wcString is now one character smaller in length and
// starts with what used to be the 2nd character
WC_GET_BUFFER_STRING
This function removes characters from a buffer.
WIDECHAR WC_GET_BUFFER_STRING (WIDECHAR A[], Length)
Length is the number of characters to remove.
Result is a WIDECHAR value.
WC_GET_BUFFER_STRING has a two-part operation:
1. Retrieve <length> number of characters from the buffer.
2. Remove the retrieved character from the buffer and shift the remaining char-
acters up to fill the gap.
wcSubStr = GET_BUFFER_STRING(wcString,3)
// wcSubStr contains first 3 characters of wcString
// wcString is now three characters smaller in length and
// starts with what used to be the 4th character
WC_LEFT_STRING
This function returns the specified number of characters from the beginning of
a string.
WIDECHAR[ ] WC_LEFT_STRING (WIDECHAR STRING[ ], LONG
Count)
Parameters
:
• STRING: The string from which to extract the characters.
• Count: The number of character to copy from the beginning of the string.
Result
:
A string containing a copy of the first Count characters from STRING.
wcSTRING = _WC('ABCDEFG')wcSubstr =
WC_LEFT_STRING(wcSTRING, 3) // wcSubstr = 'ABC'
WC_LENGTH_STRING
This function returns the length of a WIDECHAR string. This function is pro-
vides the same information as LENGTH_ARRAY.
LONG WC_LENGTH_STRING (WIDECHAR STRING[ ])
Parameters
:
• STRING: The input character string.
Result
:
The result is the length of STRING. The string length can be set implicitly
through a literal or variable string assignment or explicitly by calling
SET_LENGTH_STRING.
For example:
IF (WC_LENGTH_STRING(wcSTRING) > 0){// process string}
Summary of Contents for NETLINX PROGRAMMING LANGUAGE
Page 15: ...Table of Contents xiii NetLinx Programming Language Reference Guide...
Page 16: ...xiv NetLinx Programming Language Reference Guide Table of Contents...
Page 18: ...Introduction 2 NetLinx Programming Language Reference Guide...
Page 76: ...Language Elements 60 NetLinx Programming Language Reference Guide...
Page 106: ...Combining Devices Levels and Channels 90 NetLinx Programming Language Reference Guide...
Page 112: ...Master To Master M2M 96 NetLinx Programming Language Reference Guide...
Page 182: ...Reserved Identifiers 166 NetLinx Programming Language Reference Guide...
Page 204: ...NetLinx UniCode Functions 188 NetLinx Programming Language Reference Guide...
Page 244: ...Appendix B Glossary 228 NetLinx Programming Language Reference Guide...
Page 245: ...Appendix B Glossary 229 NetLinx Programming Language Reference Guide...