Here is the basic structure I've been using in my export programs. It does
require that the directory you are working in is setup in the VOC for the
DELETE to work - I just wanted to be extra sure that it wouldn't pick up
anything from a prior run.

EXECUTE "DELETE CONVERT.FILE, 'EXPORT.TXT'" CAPTURING XX RETURNING YY
OPENSEQ 'CONVERT.FILE', 'EXPORT.TXT' TO EXPORT.TXT THEN
  CRT 'EXPORT.TXT ALREADY EXISTS'
  STOP
END
LOOP
  READNEXT ID ELSE DONE = 1
WHILE NOT(DONE) DO
  READ REC FROM WORK.FILE, ID ELSE REC = ''
  GOSUB BUILD.LINE
  WRITESEQ LINE APPEND ON EXPORT.TXT ELSE CRT 'NOT AT END OF EXPORT.TXT'
REPEAT
*
CLOSESEQ EXPORT.TXT

I've used this on a couple of versions of UD running on windows. I've also
opened the directory as a file and done a clearfile on it. Since I have the
directory setup I could just use the regular read and write commands but
some of the items grow rather large (1 is over 1GB) this just flies through
the data. It also allows me to easily change the location of the directory.

hth
-- 
Colin Alfke
Calgary, Alberta Canada

"Just because something isn't broken doesn't mean that you can't fix it"

Stu Pickles


>-----Original Message-----
>From: Shawn Waldie [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, April 13, 2004 2:02 PM
>To: U2 Users Discussion List
>Subject: RE: [UD] OPENSEQ, WEOFSEQ, CLOSESEQ
>
>
>My main problem is resolved but your suggestions raised some other
>questions, Larry.
>
>When I take the initial WEOFSEQ out, the first run will produce the
>result I need. But if I run the program again, the error statement is
>returned each time the WRITESEQ statement is executed.  When WEOFSEQ is
>executed right after the OPEN... statement, I get the desired result
>each time I run it...also, the APPEND is no longer in the WRITE...
>statement.
>
>Something else I don't understand:
>When the file to be created/refreshed doesn't exist in X.DIR, the error
>message of the OPEN... statement is returned. Even so, the new file is
>created and written to, and I receive the desired result.  I don't get
>that one.  This happens with or without the PCPERFORM command.
>
-- 
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users

Reply via email to