Altair® Monarch®

 

Function: File

Description

Returns the path and filename of the report used to build a record.

Syntax

File()

Arguments

None.

Return value

This function returns a string in the form of a path and filename, e.g.: C:\REPORTS\ClassMay.prn.

Calculated field example

If both the ClassApr.prn report and the ClassMay.prn report were loaded from the C:\Reports folder, the following calculated field expression would return the value C:\Reports\ClassApr.prn or C:\Reports\ClassMay.prn, depending upon which report file each record in the table was extracted from: File()

Filter/Find example

The following filter or find expression would return or find those records which were extracted from the ClassApr.prn file: RSplit(File(),2,"\",1)="ClassApr.prn"

In this example, the File() function would return the path and filename of the source report file for each record in the table. The RSplit function searches the string from right to left for the backslash character (\), then splits the string at that position into two substrings, returning the rightmost substring (the filename without the path). This is then compared to the string "ClassApr.prn". Only the records extracted from the ClassApr.prn file would match this expression.