INS


The INS statement allows the insertion of elements into a dynamic array.

 

COMMAND SYNTAX

INS expression BEFORE Var<expression1{, expression2{, expression3}}>

 

SYNTAX ELEMENTS

expression evaluates to the element to be inserted in the dynamic array.

expression1, expression2 and expression3 should all evaluate to numeric values and specify the Field, Value and Sub-Value before which the new element is to be inserted.

 

NOTES

Specifying a negative value to any of expressions 1 through 3 will cause the element to be appended as the last Field, Value or Sub-Value rather than at a specific position. Only one of the expressions may be negative otherwise the first negative value is used correctly but the others are treated as the value 1.

The statement will insert NULL Fields, Values or Sub-Values accordingly if any of the specified insertion points exceeds the number currently existing.

 

EXAMPLE

Values = "
FOR I = 1 TO 50
    INS I BEFORE Values<-1>
NEXT I
FOR I = 2 TO 12
    INS I*7 BEFORE Values<7,i>
NEXT I
INSERT


INSERT

 

INSERT is the function form of the INS statement, which should be used in preference to this function.

 

COMMAND SYNTAX

INSERT(expression1, expression2{, expression3 {, expression4 }}; expression5)

 

SYNTAX ELEMENTS

expression1 evaluates to a dynamic array in which to insert a new element and will normally be a variable.

expression2, expression3 and expression4 should evaluate to numeric values and specify the Field, Value and Sub-Value before which the new element will be inserted.

expression5 evaluates to the new element to be inserted in expression1.

 

NOTES

See Also INS

 

EXAMPLES

A = INSERT(B, 1,4; "Field1Value4")


jBC