[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]] ==== No question, just a some example code to share. (OpenInsight Specific) ==== === At 05 FEB 1999 03:19:57PM B. Cameron wrote: === {{tag>"OpenInsight Specific"}} Below is a sample (stripped down) code of writing a Rev table to a Dos file in Quote-comma-Quote format. This code will write a Dos file greater than 64k or less than 64k. It is something I have written and used lots of times. It is fairly straight forward but does not include the needed file locking, or error msg routines etc., to make it complete (i.e. good code). It is meant as an example shell for anyone to make use of that might be looking for such an example on writing out to Dos file. I hope it is useful to some. And, thanks for all the answers I have gotten. ----------------------------------------------------------------------------------------------------- DosFileName=xxxxxx.xxx" * Equ DEOFM to Char(26) ;* Dos End of File Mark Equ DEORM to /0D0A/ ;* Dos End of Record Mark Equ RecLen$ to 1024 ;* You may increase or decrease * * Create or overwrite a empty Dos file with end of file marker * OSClose DosFileName OSWrite DEOFM on DosFileName * * Set the Offset (Where to begin reading Dos file from) * Offset=0 NoMore=0 * * Loop through your Rev table * Loop Readnext @ID else NoMore=1 Until NoMore do Read item From RevFile, @ID then * Ditem=" Ditem=Quote(item) Ditem=Quote(item) * Convert @FM to "," in xitem * * Now append to the DosFile * OSOpen DosFileName to Doshandle Then Loop OSBRead data From Doshandle at Offset length RecLen$ Until Index(data,DEOFM,1) Offset += RecLen$ Repeat data=Field(data,DEOFM,1):Ditem:DEOR:DEOFM) OSBWrite data on Doshandle At Offset OSClose Doshandle End End Repeat * Return 0 ----------------------------------------------------------------------------------------------------- Please comment on any erroneous errors or improvements. [[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=B9405DC3ECF1014F8525670F006FB0E0|View this thread on the forum...]]