Except for one possible inconsistency with the instructions regarding
OPENSEQ, the documentation seems very straight-forward. However, I'm
still missing something.
My intention is to:
1) create a record (if it doesn't already exist) in a DIR-type
file;
2) clear said record if data exists;
3) write "new" data to the record; and
4) close the file.
The problem is that only an empty record is created if the WEOFSEQ
command is executed. However, if the WEOFSEQ command is not executed,
the record will not first be cleared. In other words, each time someone
runs the program, the new info is appended to whatever exists.
Here's my code:
X.DIR = "X.HOME.WALDIES"
X.FILE = "SRW_TEST_SEQ.txt"
X.DELIM = "|"
********
* MAIN *
********
GOSUB OPEN.SEQFILE
FOR I = 0 TO 9
OUTPUT.DATA = ""
FOR J = 0 TO 9
BEGIN CASE
CASE J # 9
OUTPUT.DATA := I:"-":J:X.DELIM
CASE 1
OUTPUT.DATA := I:"-":J
END CASE
NEXT J
GOSUB WRITE.TO.SEQFILE
NEXT I
CLOSESEQ FV.SEQ
*~-~*~-~*~-~*~-~*~-~*~-~*~-~*~-~*~-~*~-~*~-~*~-~*~-~*~-~*
* -----------
OPEN.SEQFILE:
* -----------
PCPERFORM 'touch ':@PATH:'/':X.DIR:'/':X.FILE
OPENSEQ X.DIR,X.FILE TO FV.SEQ ELSE
CRT "File ":X.FILE:" in ":X.DIR:" didn't open!"
END
WEOFSEQ FV.SEQ
RETURN
* ---------------
WRITE.TO.SEQFILE:
* ---------------
WRITESEQ OUTPUT.DATA APPEND TO FV.SEQ ELSE
CRT "Can't append ":OUTPUT.DATA:" to ":X.FILE:" in ":X.DIR:"!"
END
RETURN
TIA
Shawn
--
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users