I may be over simplifying this but there appears to be a "STOP missing
after the CLOSESEQ command. If this is actually the case in your code, the
WEOFSEQ will be executed one last time before the program terminates.
Could this possibly be the reason?
dan
"Shawn Waldie"
<[EMAIL PROTECTED] To: "U2 Users Discussion List" <[EMAIL
PROTECTED]>
ege.edu> cc:
Sent by: Subject: [UD] OPENSEQ, WEOFSEQ,
CLOSESEQ
[EMAIL PROTECTED]
ver.com
04/13/2004 01:14 PM
Please respond to U2
Users Discussion
List
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
Note: Effective February 2, 2004, Arnold & Porter became a limited
liability partnership with the name Arnold & Porter LLP. Please
change your records accordingly. The addresses, telephone and fax
numbers, and e-mail addresses of the firm and attorneys have not changed.
----------------------------------------------------------------------
This communication may contain information that is legally privileged,
confidential or exempt from disclosure. If you are not the intended
recipient, please note that any dissemination, distribution, or copying
of this communication is strictly prohibited. Anyone who receives this
message in error should notify the sender immediately by telephone or
by return e-mail and delete it from his or her computer.
----------------------------------------------------------------------
Daniel Plocinik [EMAIL PROTECTED]
Arnold & Porter LLP Telephone: 202-274-7639
555 Twelfth Street, NW Fax: 202-942-5999
Washington, DC 20004-1202
For more information about Arnold & Porter LLP, click here:
http://www.arnoldporter.com
--
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users