` Automating Stream() and Flush() (Garry Anderson ) - Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Icetips Article

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Par2: Automating Stream() and Flush()
1998-08-21 -- Garry Anderson
 
If you want to add some template code to allow all files in your file schematic to be streamed when opened and flushed before closing, you could try something like this Make the following changes to the PROCESS.TPW Somewhere in the prompt section put a checkbox #PROMPT ('STREAM and FLUSH', CHECK), %EnableStreaming, DEFAULT(0) I put mine after the line #PROMPT ('Quick-Scan Records', CHECK), %EnableQuickScan, DEFAULT(1) The open files routine should look something like this OpenFiles ROUTINE #INSERT (%FileControlOpen) #IF (%EnableStreaming) ! STREAM Files #ENDIF #FOR (%ProcFilesUsed) #IF (%EnableStreaming) STREAM(%ProcFilesUsed) #ENDIF #ENDFOR In the ProcedureReturn ROUTINE put this at the end of the comment section #IF (%EnableStreaming) !| !| Before Closing we must FLUSH all Files that were STREAMed #ENDIF !| #FOR (%ProcFilesUsed) #IF (%EnableStreaming) FLUSH(%ProcFilesUsed) #ENDIF #ENDFOR I have only used this with TPS files TPS files supposedly flush automatically ~100 records but you still need to flush them before closing.


Today is April 25, 2024, 2:57 am
This article has been viewed 35101 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: