UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
Parameter Description Example In the following example, the program segment writes the expression BAD.ACCOUNTS to the file ACCOUNTS. A message displays if the record pointer is not at the end of the file. 1-909 UniBasic Commands Reference ON ERROR statements Specifies statements to execute if the WRITESEQ statement fails with a fatal error because the file is not open, an I/O error occurs, or UniData cannot find the file. If you do not specify the ON ERROR clause and a fatal error occurs, the program terminates. THEN statements END THEN executes if the WRITESEQ is successful. END is required to terminate multiline THEN statements. ELSE statements END ELSE executes if the WRITESEQ is not successful or the record (or ID) does not exist. END is required to terminate multiline ELSE statements. WRITESEQ BAD.ACCOUNTS TO ACCOUNTS ELSE PRINT "NOT AT END-OF-FILE" Related Commands UniBasic WRITESEQ Parameters (continued) CLOSESEQ, OPENSEQ, OSBREAD, OSBWRITE, OSCLOSE, OSDELETE, OSOPEN, READSEQ, WEOFSEQ, WRITESEQF
WRITESEQF Syntax WRITESEQF expr [APPEND] {ON | TO} seq.file.var [ON ERROR statements] {THEN statements [END] | ELSE statements [END]} Description The UniBasic WRITESEQF command writes an expression as a record on a sequential file from a current record pointer position and forces UniData to immediately write the data to the disk. Note: Before you use WRITESEQF, you must open the file by using the OSOPEN or OPENSEQ command. Tip: Use the READSEQ command to position the record pointer before using WRITESEQF. If the file is a named pipe, you cannot use WRITESEQF to write to it. You must use the OSBWRITE command. Use the READSEQ command to position the record pointer before using WRITESEQF. Parameters The following table describes each parameter of the syntax. Parameter Description expr Specifies an expression to write as a record. APPEND Use the APPEND option to start the WRITESEQF process at the end-of-file mark. If you use the APPEND option in a file that does not contain data, UniData creates a new file. ON | TO seq.file.var Specifies a sequential file variable to receive the expression. WRITESEQF Parameters WRITESEQF 1-910
- Page 926 and 927: SUBROUTINE (Delete Trigger) Syntax
- Page 928 and 929: Tip: The UniBasic STATUS function r
- Page 930 and 931: Related Commands UniBasic DEL, INSE
- Page 932 and 933: Examples In the following example,
- Page 934 and 935: In the next example, SWAP does not
- Page 936 and 937: Parameter Description 1-894 UniBasi
- Page 938 and 939: Parameter Description 1-896 UniBasi
- Page 940 and 941: TAN Syntax TAN(num.expr) Descriptio
- Page 942 and 943: TIMEDATE Syntax TIMEDATE( ) Descrip
- Page 944 and 945: Example In the following example, t
- Page 946 and 947: Parameters The following table desc
- Page 948 and 949: TRANSACTION START Syntax TRANSACTIO
- Page 950 and 951: TRIM Syntax TRIM(str.expr[,char[,ty
- Page 952 and 953: Related Commands UniBasic TRIMB, TR
- Page 954 and 955: TRIMF Syntax TRIMF(str.expr) Descri
- Page 956 and 957: Example In the following example, t
- Page 958 and 959: Parameters The following table desc
- Page 960 and 961: UNLOCK Syntax UNLOCK [num.expr] Des
- Page 962 and 963: UPCASE Syntax UPCASE(string.expr) D
- Page 964 and 965: Related Commands UniBasic PAUSE Uni
- Page 966 and 967: STATUS Function Return Values After
- Page 968 and 969: Related Commands UniBasic CLOSESEQ,
- Page 970 and 971: 1-903 UniBasic Commands Reference
- Page 972 and 973: Related Commands UniBasic CLOSE, DE
- Page 974 and 975: UniData SQL SELECT - For informatio
- Page 978 and 979: Parameter Description Example In th
- Page 980 and 981: The following table describes the r
- Page 982 and 983: Parameters The following table desc
- Page 984 and 985: WRITEU Syntax WRITEU expr {ON | TO}
- Page 986 and 987: Return Value Description Example In
- Page 988 and 989: Parameters The following table desc
- Page 990 and 991: The following example is taken from
- Page 992 and 993: Parameters The following table desc
- Page 994 and 995: C:\Program Files\Adobe\FrameMaker8\
- Page 996 and 997: C:\Program Files\Adobe\FrameMaker8\
- Page 998 and 999: C:\Program Files\Adobe\FrameMaker8\
- Page 1000 and 1001: C:\Program Files\Adobe\FrameMaker8\
- Page 1002 and 1003: C:\Program Files\Adobe\FrameMaker8\
- Page 1004 and 1005: C:\Program Files\Adobe\FrameMaker8\
- Page 1006 and 1007: C:\Program Files\Adobe\FrameMaker8\
- Page 1008 and 1009: C:\Program Files\Adobe\FrameMaker8\
- Page 1010 and 1011: C:\Program Files\Adobe\FrameMaker8\
- Page 1012 and 1013: C:\Program Files\Adobe\FrameMaker8\
- Page 1014 and 1015: C:\Program Files\Adobe\FrameMaker8\
- Page 1016 and 1017: C:\Program Files\Adobe\FrameMaker8\
- Page 1018 and 1019: C:\Program Files\Adobe\FrameMaker8\
- Page 1020 and 1021: C:\Program Files\Adobe\FrameMaker8\
- Page 1022 and 1023: C:\Program Files\Adobe\FrameMaker8\
- Page 1024 and 1025: C:\Program Files\Adobe\FrameMaker8\
Parameter Description<br />
Example<br />
In the following example, the program segment writes the expression<br />
BAD.ACCOUNTS to the file ACCOUNTS. A message displays if the record pointer<br />
is not at the end of the file.<br />
1-909 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />
ON ERROR statements Specifies statements to execute if the WRITESEQ statement<br />
fails with a fatal error because the file is not open, an I/O error<br />
occurs, or UniData cannot find the file.<br />
If you do not specify the ON ERROR clause and a fatal error<br />
occurs, the program terminates.<br />
THEN statements END THEN executes if the WRITESEQ is successful. END is<br />
required to terminate multiline THEN statements.<br />
ELSE statements END ELSE executes if the WRITESEQ is not successful or the<br />
record (or ID) does not exist. END is required to terminate<br />
multiline ELSE statements.<br />
WRITESEQ BAD.ACCOUNTS TO ACCOUNTS<br />
ELSE PRINT "NOT AT END-OF-FILE"<br />
Related <strong>Commands</strong><br />
<strong>UniBasic</strong><br />
WRITESEQ Parameters (continued)<br />
CLOSESEQ, OPENSEQ, OSBREAD, OSBWRITE, OSCLOSE, OSDELETE,<br />
OSOPEN, READSEQ, WEOFSEQ, WRITESEQF