Crestron simpl plus language ref 사용자 설명서

다운로드
페이지 374
Software Crestron 
SIMPL+
®
102 
z SIMPL+
®
Language Reference Guide - DOC. 5797G
Byte
Name:
Byte 
Syntax:
INTEGER Byte (STRING SOURCE, INTEGER SOURCE_BYTE); 
Description:
Returns the integer equivalent of the byte at position SOURCE_BYTE within a 
SOURCE string.
Parameters:
SOURCE is a STRING of characters. Each character in SOURCE is considered one 
byte.
SOURCE_BYTE references a character in the SOURCE string. The leftmost 
character in SOURCE is considered 1.
 Return Value:
An integer containing the ASCII numeric value of the byte at position 
SOURCE_BYTE in the string SOURCE. If SOURCE_BYTE is greater than the 
length of the SOURCE string or is 0, 65535 is returned.
Example:
This piece of code will examine an input string to make sure that it starts with STX 
character (02). From there, it will test the second byte and process different command 
types accordingly. 
STRING_INPUT IN$[100];
CHANGE IN$
{
IF(BYTE(IN$,1) = 02) 
{
SWITCH(BYTE(IN$,2)) 
{
CASE (65): 
{
// Process Command type 65 (A) here.
}
CASE (66): 
{
// Process Command type 66 (B) here.
}
}
Version:
SIMPL+ Version 1.00