Description
Use to replace, delete, or insert substrings in a string.
Syntax
result = FieldStore (source_string, delimiter, occurrence, field, string)
Parameters
The FieldStore function has the following parameters.
Parameter | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
source_string | Specifies the string that is to be searched, then modified. | ||||||||||
Delimiter | Any single ASCII character including field, value, or subvalue marks. This value determines what constitutes a "field" in the values of both source_string and string. | ||||||||||
Occurrence | Processing starts at the ordinal substring designated by occurrence. The value of delimiter determines the end of each "field." If the number of substrings within source_string is less than the value of occurrence, source_string will be padded with the necessary number of null substrings, before FieldStore is executed. | ||||||||||
Field | Specifies the number of substrings in string to apply to source_string. As with source_string, the value of delimiter determines the end of a substring. The value of field determines the operation insource_string.
|
See also
Example
/* The following routine changes a phone number, where the area code remains the same. */ source = '206-111-2222' ;* old number delimiter = '-' occur = 2 ;* start with 2nd field field = 2 ;* replace 2 fields string = '333-4444' ;* new number new_number = FieldStore (source, delimiter, occur, field, string)