Data-Block Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Variable Definitions and Operations > Data-Block Commands >

Data-Block Commands

GBE. - Get Block Element

Previous Top Next


MiniRobotLanguage (MRL)

 

GBE. Command

Get Block Element

 

clip0694

 

Intention

 

This command can be used to retrieve a specified element from an block (another word for a data-array). A block can be created using the CNB. - command.

 

There are two Modes of operation for GBE.:

First, you can write:

 

CNB.$$BLO|3|Element 1|Element 2|Element 3

' Result is been place on the TOS

GBN.$$BLO|1

DBP.$$000

ENR.

 

Second you can do this:

 

CNB.$$BLO|3|Element 1|Element 2|Element 3

' Result is in $$RES

GBN.$$BLO|$$NUM|$$RES

DBP.$$RES

ENR.

 

For more details on 1.5.1.5. Organizing data items in blocks see there.

 

 

 

Syntax

 

GBE.P1|P2[|P3]

 

 

Parameter Explanation

 

GBE.P1|P2

In this case P1 is taken as Block-variable. P2 is the number of the element to retrieve. The result is placed on TOS.

 

GBE.P1|P2|P3

In this case P1 is taken as Block-variable, P2 is the number of the element to retrieve.

P3 is the variable that will hold the result.

 

 

 

Example

 

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

' GBE./CNB. - Sample

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

CNB.$$BLO|3|Element 1|Element 2|Element 3

GBN.$$BLO|$$RES

FOR.$$CNT|1|$$BLO

 GBE.$$BLO|$$CNT|$$RES

 DBP.Element $$CNT is $$RES

NEX.

ENR.

 

 

 

Remarks

 

Blocks are internally checked for authenticity. This is done to prevent hard to track error.

If you change bytes or the length of a block variable externally, the block will not be unpacked anymore.

 

Data blocks can contain all 256 ASC Characters (even binary files) and are binary-compatible. Therefore whether special folders nor system variables are resolved inside blocks. Variables are resolved one time.

 

 

 

Limitations:

 

There is no explicit limit on data-items per block. However timing considerations may set you  a limit at around 10000 Items, depending on your available hardware. For a larger number of non-binary items, Member-Operations, using SBD. FEM. and SBM. may be significantly faster.

 

 

 

See also:

 

    1.5.1.3. Using Variables

    1.5.1.5. Organizing data items in blocks

    CNB. - Create New Block

    GBN. - Get Block Number

    GBE. - Get Block Element

    SBE. - Set Block Element

    SIB. - Set-In-Block

    GFB. - Get-From-Block