File Functions


Returns TRUE if the file or folder does exist.

string FILE_ISEXISTED( filename )


Gets the date of a file.

datetime FILE_DATE( filename [, type = 0 ] )

The parameter type can be one of the following:

  • 0 -- Create date and time
  • 1 -- Last write date and time
  • 2 -- Last access date and time


Gets the size of a file.

number FILE_SIZE( filename )


Gets the path from a full path filename.

string FILE_PATH( filename )

%=FILE_PATH( @"c:\\document\\abc.log")% Returns then extension "c:\\document\\"


Gets the name from a full path filename.

string FILE_NAME( filename )

%=FILE_NAME( @"c:\\abc.log")% Returns then extension "abc.log"


Gets the extension name within a full path filename.

string FILE_EXT( filename )


%=FILE_EXT( @"c:\\abc.log")% Returns then extension "log"


Returns a name for a temporary file.

string FILE_TEMPNAME( [ prefix_string = "", return_path_name = FALSE ] )

Note: The function uses up to the first three characters of this string as the prefix of the file name. The default value of the optional parameter return_path_name is FALSE.

  • %=FILE_TEMPNAME()% Returns "123123.tmp"
  • %=FILE_TEMPNAME( "abc" )% Returns "abc3123.tmp"
  • %=FILE_TEMPNAME( "abc", true )% Returns "c:\users\john\appdata\local\temp\abc3123.tmp"


Retrieves a filename from a folder.

string FILE_PICK( filename(wildchar is allowed)[, is_folder_allowed = FALSE, index = 0 ] )

The parameter index is zero-based.

  • %=FILE_PICK( 'c:\\*.jpg', FALSE, 2 )% Returns the name of the third JPG file.
  • %=FILE_PICK( "c:\\abc.jpg" )% Returns the abc.jpg if the file is existed, otherwise, returns an empty string.


Counts files of certain type in a folder.

number FILE_COUNT( filename(wildchar is allowed) [, search_for_subfolders = FALSE, is_folder_allowed = FALSE ] )


Filename Specifies a folder, and the file name. The file name can include wildcard characters, for example, an asterisk (*) or a question mark (?), and multiple items are allowed and should be separated by the colon-characeter ;. For example, "C:\WINDOWS\*.BMP;*.JPG;*.GIF", "C:\WINDOWS\*.EXE;*.DLL;*.OCX".

search_for_subfolders Optionally, specifies wether sub-folders are to be searched, if TRUE, all sub-folders in the folder will be scaned.

is_folder_allowed Optionally, specifies wether the folder is to be counted. If FALSE, only file will be counted.


  • %=FILE_COUNT( 'c:\\*.jpg;*.bmp', FALSE, FALSE )% Returns the number of JPG and BMP files in the root folder of C.
  • %=FILE_COUNT( @"c:\\temp\\abc.jpg", TRUE )% Returns the number of abc.jpg in the fodler c:\temp and its sub-folders.


The attachments will be extracted into the temporary folder when a macro execute, using the function FILE_ATTACH_PATHNAME can get the fullpath name of an attachment. In general, using this function to extract an attachment file while the macro is running.

string FILE_ATTACH_PATHNAME( attachment_name )


attachment_name Specifies the name of the attachment.


  • %=FILE_ATTACH_PATHNAME( 'abc')% It returns the full pathname of the attachment 'abc'.


Gets the width or height of an image file.

IMG_RES( filename [, what = 0 ] )

The parameter what can be one of the follow:

  • 0 (Default value) -- Retrieves a string to represent the size in the format width x height. For example: 100x200
  • 1 -- Retrieves the number value of the width of the image.
  • 2 -- Retrieves the number value of the height of the image.

%=IMG_RES( @"c:\\abc.jpg")% Returns a string "100x200"
%=IMG_RES( @"c:\\abc.jpg", 1)% Returns the number 100


Loads an image file and returns a binary data. This function can be used in the action "Input dialog" to show an image, and also be used in the built-in function "BASE64_ENCODE" to base64 an image

binary IMG_LOAD( filename )


%=IMG_LOAD( @"c:\\a.jpg")% Loads the image data from the file a.jpg