MID

Provided by Standard Library.

Function of type STRING, returns a partial string from within a string.

Inputs:

STR : STRING; string to be analyzed

LEN : INT; length of the partial string (number of characters), value must be greater or equal “0”.

POS : INT; start position for the partial string, number of characters counted from the left of STR, starting with “1”

Return value: STRING, partial string

MID (STR, LEN, POS) means: Retrieve LEN characters from the STR string beginning with the character at position POS.

Example in IL: ( Result is ‘US’ )\ \ \ \

../_images/002f24551e8f7f95c0a8640e01947982

Example in FBD:\ \ \ \

../_images/8af8bdeb1e8f7ed7c0a8640e01947982

Example in ST:\ \ \ \

VarSTRING1 := MID ('SUSI',2,2);