System functions provide access to Articles application folders, connection settings, and application control. Debug functions help diagnose issues during report development by inspecting values and logging output. Debug functions should be removed or disabled before distributing a report.
AppShutdown
Closes the Articles application. Use with caution โ this immediately shuts down the entire application when called.
procedure AppShutdown
// Close Articles after a report finishes in a kiosk or automated scenario
procedure frxReport1StopReport(Sender: TObject);
begin
if [Param.AutoClose] then
AppShutdown;
end;
Dump
Returns a string representation of a variant value including its type and content. Useful during development to inspect what a field or expression actually contains.
Dump(V: Variant): String
| Parameter | Type | Description |
|---|---|---|
| V | Variant | The value to inspect |
// Place in a text object during development to inspect a field
// [Dump([Orders.Total])]
// Might return: 'Double: 1250.75'
// Use in a script to log the dump output
Log(Dump([Customer.CreditStatus]));
// Useful when a field returns unexpected results
ShowMessage(Dump([Item.Code]));
GetConnectionNames
Returns a string containing all available database connection definition names. Useful for debugging connection issues or building dynamic connection selectors.
GetConnectionNames: String
// Show all available connections during development
ShowMessage(GetConnectionNames);
// Log connection names for troubleshooting
Log('Available connections: ' + GetConnectionNames);
GetDatabaseDefsFileName
Returns the full file path to the Articles connection definitions file.
GetDatabaseDefsFileName: String
// Show the path to the connections file
Result := GetDatabaseDefsFileName;
// Returns something like: 'C:\ProgramData\DataSoft\Articles\Connections.xml'
// Log during troubleshooting
Log('Connection defs file: ' + GetDatabaseDefsFileName);
GetImageFolder
Returns the full path to the Articles image folder where report images and logos are stored.
GetImageFolder: String
Result := GetImageFolder;
// Returns something like: 'C:\ProgramData\DataSoft\Articles\Images\'
// Build a full path to a specific image
var logoPath := GetImageFolder + 'CompanyLogo.png';
GetReportFolder
Returns the full path to the Articles report folder where report templates are stored.
GetReportFolder: String
Result := GetReportFolder;
// Returns something like: 'C:\ProgramData\DataSoft\Articles\Reports\'
// Build a path to a specific report file
var reportPath := GetReportFolder + 'Invoices\SalesInvoice.fr3';
GetRootFolder
Returns the full path to the Articles program installation folder.
GetRootFolder: String
Result := GetRootFolder;
// Returns something like: 'C:\Program Files\DataSoft\Articles\'
// Log the install location during troubleshooting
Log('Articles installed at: ' + GetRootFolder);
GetSettingsFolder
Returns the full path to the Articles settings folder where configuration and preferences are stored.
GetSettingsFolder: String
Result := GetSettingsFolder;
// Returns something like: 'C:\ProgramData\DataSoft\Articles\Settings\'
// Build a path to a settings file
var iniPath := GetSettingsFolder + 'ReportPreferences.ini';
GetTemplateFolder
Returns the full path to the Articles template folder where report template files are stored.
GetTemplateFolder: String
Result := GetTemplateFolder;
// Returns something like: 'C:\ProgramData\DataSoft\Articles\Templates\'
// Reference a template file by building its full path
var templatePath := GetTemplateFolder + 'LetterHead.fr3';
Log
Sends a debug message to the CSDispatcher.exe debug console window. Use this during report development to trace values, confirm code is executing, and diagnose problems. Has no effect in production if CSDispatcher is not running.
procedure Log(S: String)
| Parameter | Type | Description |
|---|---|---|
| S | String | The message to send to the debug console |
// Log a field value during development
Log('Customer ID: ' + VarToStr([Customer.ID]));
// Confirm a code branch is being reached
Log('Entering tax calculation block');
var tax := RoundTo2([Orders.Total] * [Tax.Rate]);
Log('Tax calculated: ' + FormatCurrencySafe(tax));
// Log the result of a function call
Log('Phone formatted: ' + FormatPhone(CleanNumber([Customer.Phone])));
// Trace loop iteration
var i: Integer;
for i := 1 to 5 do
Log('Processing item ' + IntToStr(i));
ShowType
Returns a string describing the data type of a variant value. Useful during development when a field returns an unexpected type that causes errors in expressions.
ShowType(V: Variant): String
| Parameter | Type | Description |
|---|---|---|
| V | Variant | The value to inspect |
// Check the type of a field during development
// [ShowType([Orders.Total])]
// Might return: 'Double'
// [ShowType([Customer.ID])]
// Might return: 'Integer'
// Use with Log for non-intrusive type checking
Log('Type of OrderDate: ' + ShowType([Orders.OrderDate]));
Log('Type of Balance: ' + ShowType([Customer.Balance]));
Debug Function Usage Notes
The Log, Dump, and ShowType functions are intended for use during report development only. Before distributing a finished report:
- Remove or comment out allย
Logย calls - Remove any text objects containingย
Dumpย orยShowTypeย expressions Logย is harmless if left in when CSDispatcher is not running, butยDumpย andยShowTypeย will display raw type information to end users if left in text objects