Mid - Crestron SIMPL+ Reference Manual

Language reference guide
Hide thumbs Also See for SIMPL+:
Table of Contents

Advertisement

Crestron SIMPL+
Language Reference Guide - DOC. 5797G
®

Mid

Name:
Mid
Syntax:
STRING Mid(STRING SOURCE, INTEGER START, INTEGER NUM);
Description:
Returns a string NUM characters long from SOURCE, starting at position START.
Parameters:
SOURCE is a STRING containing the input string.
START is an INTEGER telling MID at which character position in SOURCE to start.
The first character of SOURCE is considered 1.
NUM is an INTEGER telling MID how many characters to use from SOURCE.
Return Value:
A string NUM characters long starting at START.
If START is greater than the length of SOURCE, an empty STRING is returned.
If NUM is greater than the total number of characters that can be retrieved starting
from START, only the remaining characters in SOURCE will be pulled. For
example, MID("ABCD", 2, 10) would return a STRING containing BCD.
Example:
STRING_INPUT Var$[100];
STRING Temp$[100];
CHANGE Var$
{
Temp$ = MID(Var$, 2, 5);
PRINT("String starting at position 2 for 5 characters is
%s\n",Temp$);
}
In this example, if Var$ contains "abcdefghijklmnop", then Temp$ will contain
"bcdef".
Version:
SIMPL+ Version 1.00
Software
®
SIMPL+
227

Advertisement

Table of Contents
loading

Table of Contents