String Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > String commands > !BLO.-Block-Commands > Block Extraction >

String Operations

BLO.BlockGetAllContent

Previous Top Next


MiniRobotLanguage (MRL)

 

BLO.BlockGetAllContent

Gets all block contents into an ARR array.

 

clip1139

 

Intention

 

This command scans a source string and finds all complete, top-level blocks. It then extracts the content *inside* the delimiters of each block and populates a specified ARR array with these content strings. The total number of items found is returned on the Top of Stack (TOS).

 

Visual Example

 

Getting All Top-Level Block *Contents*

 

                               ┌─ Content 1 ─┐    ┌─ Content 2 ─┐   ┌─ Content 3 ─┐

             Source String:  <tag>Hello </tag>   <tag>World</tag>  <tag>Again</tag>

                               └─────┬───────┘    └─────┬───────┘   └─────┬─vv────┘

                                     │                  │                 │

                                     ▼                  ▼                 ▼

                   Result Array: [ "Hello",          "World",          "Again" ]

 

 

Syntax

 

BLO.BlockGetAllContent|P1|P2|P3|P4

 

Parameter Explanation

 

P1 - (Input, Text) The source string to search within.

P2 - (Input, Text) The starting delimiter string.

P3 - (Input, Text) The ending delimiter string.

P4 - (Input, Numeric) The number of the destination ARR array to populate.

 

Example

 

'***********************************

' BLO.BlockGetAllContent Example

'***********************************

$$SRC=[A]1[Z] [A]2[Z] [A]3[Z]

BLO.BlockGetAllContent|$$SRC|[A]|[Z]|5

' ARR array #5 now contains 3 elements:

' Index 0: "1"

' Index 1: "2"

' Index 2: "3"

ARR.Show|5

MBX.!

ENR.