RE: WEOFSEQ
if the file x.file exists, it will write an end of file marker on it. +-erasing what was in x.file. it won't ( should not ) clear the x.dir directory. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Shawn Waldie Sent: Wednesday, April 14, 2004 1:49 PM To: U2 Users Discussion List Subject: WEOFSEQ I need some clarification. Given the following: X.DIR = X.HOME.WALDIES; * the VOC item 'X.HOME.WALDIES' is a pointer to /home/waldies X.FILE = SRW_TEST_SEQ.txt OPENSEQ X.DIR,X.FILE TO FV.SEQ THEN WEOFSEQ FV.SEQ ELSE ... END Upon a successful open of X.DIR at X.FILE, will the WEOFSEQ erase everything in X.DIR starting with X.FILE, including other files that may exist under - positionally - X.FILE? Or is it just suppose to clear anything that might be contained in X.FILE? This what the *help* says: The UniBasic WEOFSEQ command writes an end-of-file mark at the record pointer position in a sequential file, which results in the file (...in my case, X.DIR or X.FILE?) being truncated at the current position. TIA -- u2-users mailing list [EMAIL PROTECTED] http://www.oliver.com/mailman/listinfo/u2-users This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. -- u2-users mailing list [EMAIL PROTECTED] http://www.oliver.com/mailman/listinfo/u2-users
Re: WEOFSEQ
From: Shawn Waldie [EMAIL PROTECTED] Sent: Wednesday, April 14, 2004 1:48 PM I need some clarification. Given the following: X.DIR = X.HOME.WALDIES; * the VOC item 'X.HOME.WALDIES' is a pointer to /home/waldies X.FILE = SRW_TEST_SEQ.txt OPENSEQ X.DIR,X.FILE TO FV.SEQ THEN WEOFSEQ FV.SEQ ELSE ... END Upon a successful open of X.DIR at X.FILE, will the WEOFSEQ erase everything in X.DIR starting with X.FILE, including other files that may exist under - positionally - X.FILE? Or is it just suppose to clear anything that might be contained in X.FILE? snip You *didn't* open X.DIR. You opened sequentiall X.FILE within X.DIR onto filepointer FV.SEQ. As a sidenote, all actions that you take using FV.SEQ must be sequential actions such as WRITESEQ, WEOFSEQ, CLOSESEQ. I'm not sure what would happen if you used a normal WRITE or CLOSE statement on that filepointer, I hope and suspect the program would bomb. -- u2-users mailing list [EMAIL PROTECTED] http://www.oliver.com/mailman/listinfo/u2-users
RE: WEOFSEQ
It will only clear whatever data is already in X.FILE. It appears I made an incorrect statement in a previous post, and I must correct myself. I previously stated that WRITESEQ will overwrite and effectively clear a file. It does not. The sequential file must be positioned at the end of file before a WRITESEQ is executed, or the write will fail, and the ELSE clause will be taken. There are three ways to do this: 1) READSEQ until eof 2) Use the APPEND clause to the WRITESEQ statement 3) WEOFSEQ (truncates the file at the current position, effectively making the end of file) I revise my basic flow as follows: OPENSEQ 'dirfile','seq.file.name' TO FIL.SEQ THEN WEOFSEQ FIL.SEQ END ELSE IF STATUS() NE 0 THEN PRINT 'Could not open/create seq.file.name' STOP END END * Loop through data build seq records WRITESEQ var ON FIL.SEQ ... * At eof CLOSESEQ FIL.SEQ (No WEOFSEQ required here) Larry Hiscock Western Computer Services http://www.wcs-corp.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Shawn Waldie Sent: Wednesday, April 14, 2004 10:49 AM To: U2 Users Discussion List Subject: WEOFSEQ I need some clarification. Given the following: X.DIR = X.HOME.WALDIES; * the VOC item 'X.HOME.WALDIES' is a pointer to /home/waldies X.FILE = SRW_TEST_SEQ.txt OPENSEQ X.DIR,X.FILE TO FV.SEQ THEN WEOFSEQ FV.SEQ ELSE ... END Upon a successful open of X.DIR at X.FILE, will the WEOFSEQ erase everything in X.DIR starting with X.FILE, including other files that may exist under - positionally - X.FILE? Or is it just suppose to clear anything that might be contained in X.FILE? This what the *help* says: The UniBasic WEOFSEQ command writes an end-of-file mark at the record pointer position in a sequential file, which results in the file (...in my case, X.DIR or X.FILE?) being truncated at the current position. TIA -- u2-users mailing list [EMAIL PROTECTED] http://www.oliver.com/mailman/listinfo/u2-users -- u2-users mailing list [EMAIL PROTECTED] http://www.oliver.com/mailman/listinfo/u2-users