UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
Examples The following program statement eliminates the record with the ID of PEANUT from the default file: DELETE "PEANUT" The following program segment deletes the record whose ID is specified by the variable DEL_ID from the file previously opened to the PARTS variable: DEL_ID = "HOOK" DELETE PARTS, DEL_ID The following statement is invalid because the file variable is specified incorrectly in the DELETE statement: 1-203 UniBasic Commands Reference OPEN 'CUSTOMER' TO CUST ELSE STOP 'NO CUST' DELETE CUSTOMER, C.ID The following program segment is taken from “Appendix A, Sample Program” of Developing UniBasic Applications. The DELETE command deletes the record in the ORDERS file after the corresponding attribute is deleted from the CLIENTS file. Both steps are necessary to remove the order record itself, and to remove the reference to the order in the client record (the attribute in the CLIENTS file). DELETE_RECORD: * (Assuming the order #'s are on line 12) READVU ORDER_LINE FROM CLIENT_FILE,CLIENT_NUMBER,12 THEN LOCATE ORDER_NUMBER IN ORDER_LINE SETTING POSITION THEN DEL ORDER_LINE END WRITEV ORDER_LINE ON CLIENT_FILE, CLIENT_NUMBER, 12 END * DELETE ORDERS_FILE, ORDER_NUMBER RELEASE CLIENT_FILE,CLIENT_NUMBER RETURN Related Commands UniBasic DEL, DELETE, DELETEU
DELETE Syntax DELETE(dyn.array, attrib.expr[,val.expr [,subval.expr]]) Description The UniBasic DELETE function deletes an attribute, value, or subvalue from a dynamic array. The corresponding delimiter is also removed. The DELETE function and the DEL command perform the same action. Parameters The following table describes each parameter of the syntax. Parameter Description dyn.array.var Specifies the dynamic array from which to delete. attrib.expr Specifies which attribute of the dynamic array to delete. If val.expr is omitted, DELETE deletes the entire attribute, including all values and subvalues. ,val.expr Specifies which value of the dynamic array attribute to delete. If subval.expr is omitted, DELETE deletes the entire value, including all subvalues. ,subval.expr Specifies which subvalue of the dynamic array attribute value to delete. DELETE Parameters Examples In this first example, the program segment deletes the first attribute (125) and the attribute mark from the dynamic array ARRAY: ARRAY = 125:@AM:1:@VM:62:@VM:3:@AM:132:@VM:4:@VM:5:@SM:1 ARRAY=DELETE(ARRAY,1,0,0) DELETE 1-204
- Page 152 and 153: closeSocket Syntax closeSocket(sock
- Page 154 and 155: COL1 Syntax COL1( ) Description The
- Page 156 and 157: COMMON Syntax COMMON [/common.name/
- Page 158 and 159: 1-161 UniBasic Commands Reference
- Page 160 and 161: UniData DELETECOMMON, STACKCOMMON -
- Page 162 and 163: Related Command UniBasic EXIT 1-165
- Page 164 and 165: In the next example, the program se
- Page 166 and 167: In the next example, the program se
- Page 168 and 169: COUNT Syntax COUNT(str.expr1, str.e
- Page 170 and 171: COUNTS Syntax COUNTS(expr,str.expr)
- Page 172 and 173: createCertificate Syntax createCert
- Page 174 and 175: createCertRequest Syntax createCert
- Page 176 and 177: Parameter Description The following
- Page 178 and 179: The following table describes the a
- Page 180 and 181: createSecureRequest Syntax createSe
- Page 182 and 183: Method Description The following ta
- Page 184 and 185: Parameters The following table desc
- Page 186 and 187: DATA Syntax DATA expr1 [,expr2]...
- Page 188 and 189: DBTOXML Syntax DBTOXML(xml_document
- Page 190 and 191: DCOUNT Syntax DCOUNT(str,delim) Des
- Page 192 and 193: DEACTIVATEKEY Syntax DEACTIVATEKEY
- Page 194 and 195: STATUS Code Example The following e
- Page 196 and 197: DEFFUN Syntax DEFFUN function.name
- Page 198 and 199: The preceding program calls the fol
- Page 200 and 201: Examples The following program segm
- Page 204 and 205: In the next example, the program st
- Page 206 and 207: UniData SQL SELECT - For informatio
- Page 208 and 209: Examples In the following example,
- Page 210 and 211: Parameters The following table desc
- Page 212 and 213: DIGEST Syntax DIGEST(algorithm, dat
- Page 214 and 215: DIR Syntax DIR(file.expr) Descripti
- Page 216 and 217: STATUS Codes DISABLEDEC has the fol
- Page 218 and 219: DISPLAYWIDTH Syntax DISPLAYWIDTH (s
- Page 220 and 221: DQUOTE DQUOTE is a synonym for the
- Page 222 and 223: Related Commands UniBasic PRECISION
- Page 224 and 225: ECHO Syntax ECHO [ON | OFF | expr]
- Page 226 and 227: EDADRV_CloseStmt Syntax RETCODE EDA
- Page 228 and 229: EDADRV_Connect Syntax RETCODE EDADR
- Page 230 and 231: EDADRV_Disconnect Syntax RETCODE ED
- Page 232 and 233: 1-226 UniBasic Commands Reference
- Page 234 and 235: Return Codes The following table de
- Page 236 and 237: Output Variable The following table
- Page 238 and 239: Output Variables The following tabl
- Page 240 and 241: EDADRV_GetDBInfo Syntax RETCODE EDA
- Page 242 and 243: EDADRV_GetEDAAttr Syntax RETCODE ED
- Page 244 and 245: EDADRV_GetErrmsg Syntax RETCODE EDA
- Page 246 and 247: Input Variables The following table
- Page 248 and 249: EDADRV_LoadSymbols Syntax RETCODE E
- Page 250 and 251: Output Variables The following tabl
Examples<br />
The following program statement eliminates the record with the ID of PEANUT from<br />
the default file:<br />
DELETE "PEANUT"<br />
The following program segment deletes the record whose ID is specified by the<br />
variable DEL_ID from the file previously opened to the PARTS variable:<br />
DEL_ID = "HOOK"<br />
DELETE PARTS, DEL_ID<br />
The following statement is invalid because the file variable is specified incorrectly in<br />
the DELETE statement:<br />
1-203 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />
OPEN 'CUSTOMER' TO CUST ELSE STOP 'NO CUST'<br />
DELETE CUSTOMER, C.ID<br />
The following program segment is taken from “Appendix A, Sample Program” of<br />
Developing <strong>UniBasic</strong> Applications. The DELETE command deletes the record in the<br />
ORDERS file after the corresponding attribute is deleted from the CLIENTS file.<br />
Both steps are necessary to remove the order record itself, and to remove the<br />
reference to the order in the client record (the attribute in the CLIENTS file).<br />
DELETE_RECORD:<br />
* (Assuming the order #'s are on line 12)<br />
READVU ORDER_LINE FROM CLIENT_FILE,CLIENT_NUMBER,12 THEN<br />
LOCATE ORDER_NUMBER IN ORDER_LINE SETTING POSITION THEN<br />
DEL ORDER_LINE<br />
END<br />
WRITEV ORDER_LINE ON CLIENT_FILE, CLIENT_NUMBER, 12<br />
END<br />
*<br />
DELETE ORDERS_FILE, ORDER_NUMBER<br />
RELEASE CLIENT_FILE,CLIENT_NUMBER<br />
RETURN<br />
Related <strong>Commands</strong><br />
<strong>UniBasic</strong><br />
DEL, DELETE, DELETEU