DerivedFileManager
is an example project showcasing how to extend the ABC FileManager in Clarion. It includes two Clarion files: ModFM.INC
(a class definition) and ModFM.CLW
(source code), which derive from the ABC FileManager. This extension adds several methods to enhance the functionality of the original FileManager, making it more versatile, especially for SQL file management.
The DerivedFileManager
class introduces the following methods to the ABC FileManager:
IsSQLFile
: Determines if the file is an SQL file.DBTraceOn
: Activates Clarion table tracing for the file, with output directed toOutputDebugString
.DBTraceOff
: Deactivates Clarion table tracing for the file, stopping output toOutputDebugString
.TRACE
: Sends a message toOutputDebugString
, prefixed by the table name.
Additionally, the derived Init
method demonstrates setting the file's PROP:Alias
to the prefix of the file, a technique beneficial for SQL definitions.
To integrate DerivedFileManager
into your Clarion projects, follow these steps:
- Copy
ModFM.INC
andModFM.CLW
to yourClarionDirectory\Accessories\libsrc\Win
directory. - For each application that requires
DerivedFileManager
, navigate to the Global Properties:- Go to
Actions
>Classes
Tab >File Management
. - Select
ModFM
from the FileManager dropdown menu.
- Go to
This process ensures that your application uses the enhanced file management capabilities provided by DerivedFileManager
.
To control tracing for a specific file manager instance, you can use the DBTraceOn
and DBTraceOff
methods. Here's how you might do it:
! To turn on tracing for a table
ACCESS:TableName.DBTraceOn()
! To turn off tracing for the same table
ACCESS:TableName.DBTraceOff()
! Sending a custom trace message
ACCESS:TableName.TRACE('Your custom message here')