UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software

rocketsoftware.com
from rocketsoftware.com More from this publisher
11.04.2013 Views

INSERT Syntax INSERT(dyn.array.expr,attrib.expr,val.expr, subval.expr, insert.expr) Description The UniBasic INSERT function inserts an expression (with its delimiter) before or after the specified attribute, value, or subvalue mark in a dynamic array. There is no short form for the INSERT function. However, you can append data by using the short version of the REPLACE function. Parameters The following table describes each parameter of the syntax. Parameter Description dyn.array.expr, attrib.expr, val.expr, subval.expr, Elements in dyn.array.expr,attrib.expr,val.expr, and subval.expr can be any of the following three types. 1-399 UniBasic Commands Reference Specifies a dynamic array and attribute, value, and subvalue of that dynamic array at which to insert the expression. For more information about the type of insertions available, see the following table. insert.expr Specifies the string to insert. INSERT Parameters If the element is: then insert expr: a positive number after delimiter, before data. -1 (attrib.expr,val.expr, subval.expr) after the position indicated. 0 (val.expr, subval.expr) at the next higher level. Determining Insertion Points

Examples In the following example, the program statement inserts HARRY at the end of the values in attribute 2: STR = INSERT(STR,2,-1,0,'HARRY') In the next example, the program statement inserts HARRY in the first value of attribute 2: STR = INSERT(STR,2,1,0,'HARRY') In the next example, the program statement inserts HARRY in the first subvalue of the first value of attribute 2: STR = INSERT(STR,2,1,1,'HARRY') In the next example, the program segment specifies Alias in the second attribute position: ARRAY = "#111":@AM:"Jones":@AM:"Smith" ARRAY2 = INSERT(ARRAY,2,0,0,"Alias") When you execute this program segment, UniData inserts Alias in the second attribute position: ARRAY2 = "#111":@AM:"Alias":@AM:"Jones":@AM:"Smith" Related Commands UniBasic DEL, FIELDSTORE, INS, REMOVE, REPLACE, SUBSTRINGS INSERT 1-400

INSERT<br />

Syntax<br />

INSERT(dyn.array.expr,attrib.expr,val.expr, subval.expr, insert.expr)<br />

Description<br />

The <strong>UniBasic</strong> INSERT function inserts an expression (with its delimiter) before or<br />

after the specified attribute, value, or subvalue mark in a dynamic array.<br />

There is no short form for the INSERT function. However, you can append data by<br />

using the short version of the REPLACE function.<br />

Parameters<br />

The following table describes each parameter of the syntax.<br />

Parameter Description<br />

dyn.array.expr,<br />

attrib.expr,<br />

val.expr,<br />

subval.expr,<br />

Elements in dyn.array.expr,attrib.expr,val.expr, and subval.expr can be any of the<br />

following three types.<br />

1-399 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />

Specifies a dynamic array and attribute, value, and subvalue of that<br />

dynamic array at which to insert the expression. For more information<br />

about the type of insertions available, see the following table.<br />

insert.expr Specifies the string to insert.<br />

INSERT Parameters<br />

If the element is: then insert expr:<br />

a positive number after delimiter, before data.<br />

-1 (attrib.expr,val.expr, subval.expr) after the position indicated.<br />

0 (val.expr, subval.expr) at the next higher level.<br />

Determining Insertion Points

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!