Data-Block Commands

<< Click to Display Table of Contents >>

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

Data-Block Commands

GBN. - Get Block Number

Previous Top Next


MiniRobotLanguage (MRL)

 

GBN. Command

Get Block Elements Count

 

clip0695

 

Intention

 

How many independent data-items are in a given data-block?

GBN. will tell you the answer to this question..

 

GBN. can be used to retrieve the number of elements in 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

GBN.$$BLO

DBP.$$000

ENR.

 

Second you can do this:

 

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

GBN.$$BLO|$$RES

DBP.$$RES

ENR.

 

In this case the result will be in a variable, instead of on TOS.

 

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

 

 

 

Syntax

 

GBN.P1[|P2]

 

 

Parameter Explanation

 

GBN.P1

In this case P1 is taken as Block-variable. The result (number of blocks in that variable) is placed on TOS.

 

GBN.P1|P2

In this case P1 is taken as Block-variable, P2 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|$$RES

 GBE.$$BLO|$$CNT|$$ELE

 DBP.Element $$CNT is $$ELE

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