basic.substring.extraction Definition/BASIC Program

basic.substring.extraction

Command basic.substring.extraction Definition/BASIC Program
Applicable release versions: AP, R83
Category BASIC Program (486)
Description allows the extraction of a string from within another string.

The "beg.pos.expression" must evaluate to a number indicating the starting position within the string, and the "len.expression" must evaluate to a number indicating the number of characters to retrieve.

If the starting character specification is past the end of the string value, an empty substring value is selected. If the starting character specification is negative or zero, the substring is assumed to start at character one.

If the substring length specification exceeds the remaining number of characters in the string, the remaining string is selected. If the substring length specification is negative or zero, an empty substring is selected.
Syntax string.expression[beg.pos.expression, len.expression]
Options
Example
if response[1,1] = "y" then printer on 

This tests the first character of "response" to determine if it is 
the letter "y". If it is, the "printer on" statement is 
issued. See "casing" for case-sensitive input.

area.code = phone[1,3]

This extracts the first three characters of the "phone" variable and 
assigns it to the variable "area.code"
Purpose
Related basic.[
basic.field
basic.assignment
basic.casing
basic.substring.assignment
basic.substring.expressions
basic.substring.field.store