Welcome to jBASE's new documentation site! Many answers to your questions can be found by searching the Knowledgebase or viewing the jBASE Documentation. We also have a Google Group for peer discussion about jBASE. If you are unable to find the information you are looking for, jBASE Support will be glad to assist in resolving your technical problems. Enjoy and please provide comments and feedback .

How can we help you?

SUBSTRINGS

Description

The SUBSTRINGS function returns a dynamic array of elements, which are sub-strings of the corresponding elements in a supplied dynamic array. 

SUBSTRINGS(dynarr, Start, Length)

Where:

dynarr should evaluate to a dynamic array.

Start specifies the position from which characters are extracted from each array element. It should evaluate to an integer greater than zero.

Length specifies the number of characters to extract from each dynamic array element. If the length specified exceeds the number of characters remaining in an array element then all characters from the Start position are extracted.

INTERNATIONAL MODE

When using the SUBSTRINGS function in International Mode, the function will use the ‘start’ and length’ parameters to the function as character count values, rather than bytecount

The following example shows how each element of a dynamic array can be changed.

t = ""
t<1> = "AAAAA"
t<2> = "BBBBB" : @VM: "CCCCC" : @SVM: "DDDDD"
t<3> = "EEEEE":@VM:@SVM
r1 = SUBSTRINGS (t,3,2)
r2 = SUBSTRINGS(t,4,20)
r3 = SUBSTRINGS(t,0,1)

The above program creates 3 dynamic arrays. v represents a value mark. s represents a sub-value mark.


Go back to jBASE BASIC

Was this article helpful?