Mid
Syntax: Mid(inputString, offset, length)
Arguments:
- inputString is a string or a field or variable that holds a string.
- offset is an integer number.
- length is an integer number.
Return Type: String
Description: From the inputString string, returns a certain number of characters, beginning at a certain character. The length argument determines the number of characters returned, and the offset argument determines the beginning point. Counting is zero-based—the first character in the string is considered to be at position zero.
Example:
MidString is a string;
MidString = Mid(CRTRAN25.PAN,4,6);
if (MidString >= "350000" AND MidString <= "399999")
then {... ;}
This rule acts upon authorizations associated with accounts whose numbers fall within a defined range. It begins by creating a string variable called MidString. It then tests whether the transaction is an authorization. If so, it uses the Mid function to set MidString to six digits of the account number, starting at the fifth digit (in zero-based counting, the value 4 indicates the fifth digit). An IF clause then tests whether the MidString value falls between two numbers, 350000 and 399999; if so, a THEN clause is evaluated.