AMT Help Files

FindFiles.dll

As of LION6.NET Patch 2 Findfiles.dll is obsolete and is not distributed in AMT. All the necessary functionality is in the normal File Control Functionality functions that are handled by the File controller of AMT.
For older AMT applications with findfiles calls already present, it is possible to call either 'FINDFILES' or 'FINDFILES.dll' as a backwards compatibility feature.
As this feature will not be developed further, it is strong advised to change these calls to the File Control Functionality directly when updating the older code.

 

AMT used to deliver standard a DLL called "Findfiles.dll". This component contains some functions that can be put to use in your own generated application(s). The functions are available in your forms as well as in reports.

All parameters that are passed, are to be separated by comma's. Also the returned parameters are separated by comma's (,).

When functions are used for getting date and/or time stamps, AMT will return these values according to the standard GMT. This means that the corrections that are done through the local time settings in Windows do not apply on the data that is stored in SI-PARAM.

 

The following functions are available:

APPENDTOFILE

To enlarge an existing file from SI-PARAM in screen logic
If the recordsize is -1 then the <CR><LF> are not translated otherwise all records
in the file will get the specified length. The specified file has to exist.

Input : <filename>,<recordsize>,<content>

Result: <spaces> | <error message>

Example:


DIRECTORYCREATE

To create a directory, eventually with subdirectories.

Input: <dirname>

Result: <spaces> | <error message>

Example:


DIRECTORYDELETE

To delete a directory. Deletion will only be done when the directory is empty.

Input : <dirname>

Result: <spaces> | <error message>

Example:


FILECOPY

To copy a file.

Input : <filename 1>,<file name 2>

Result: <spaces> | <error message>

Example:


FILEDELETE

To delete a file.

Input : <filename>

Result: <spaces> | <error message>

Example:


FILEMOVE

To rename a file.

Input : <filename 1>,<file name 2>

Result: <spaces> | <error message>

Example:


FINDALLFILES

To find all files in a directory that correspond to the specified file mask.
the resulting list is stored in a file.
each line in this file represents a found file, and shows:
< the name of the file >,
< the number of bytes >,
< the date/time of creation >,
< the date/time of last accessed >,
< the date/time of last modified >

Input : <directory + filemask> , <outputfile>

Result: <spaces> | <error message>

Example:


FINDDIRECTORY

To find the first subdirectory or all subdirectories that correspond(s) to the specified mask.
The result is returned comma-separated in SI-PARAM

Input : <directory + mask> | [,ALL];

Result: <spaces> | <dirname>[,<dirname>]

Example:


FINDFILE

To find a file that corresponds to the specified file mask.

Input : <directory + filemask>

Result: <spaces> | <filename>,<filesize>

Example:


GETFILEDATE

To obtain time-stamps of a file
the result is returned as three date/times, comma-separated in SI-PARAM
< the date/time of creation >,
< the date/time of last accessed>,
< the date/time of last modified

Input : <filename> [, <file size>]

Result: <spaces> | <ddmmccyy hhmmss>,<ddmmccyy hhmm>>,<ddmmccyy hhmm>

Example:


GETFILESIZE

To check whether a file is still growing in size

Input : <filename> [, <file size>]

Result: <spaces> | <filename>,<file size>

Example:


GIVEFILECONTENT

To read a file content into SI-PARAM in screen logic
Reads a file from the disk and places the result in SI-PARAM. If the recordsize
is -1 then the <CR><LF> are not translated. Otherwise, all lines are filled
to that size and concatenated without <CR><LF>. If a line is too long it is
automatically split up into multiple lines.

Input : <filename>,<recordsize>

Result: <file content> | <error message>

Example:


ISFILELOCKED

To check whether a file is locked by another program

Input : <filename>

Result: <spaces> | "LOCKED"

Example:


REPLACESTRING

Replaces all occurrences of the <original string> in the <original file> by the <new string>, unless an optional <new file> is specified.

If a <new file> is specified, the <original file> will not be changed. If the <new file> already exists, it will be overwritten with the new file content (without a warning). If the <new file> does not exist yet, this file will be created automatically and it will be filled instantly, using the new strings.

Input : <original file>, <original string>, <newstring>[, <new file>]

Result: <spaces> | <error message>

Notes:

  • AMT does not expect a specified <new file> to be the same as the specified <original file>. If you would specify the same file both as <original file> and <new file>, AMT will act the same way as if no <new file> would be specified. So, the <original file> will then be overwritten.
  • Please be careful when using this option to avoid loss of indispensable data when (accidentally) overwriting a file.


SHRINKFILETONNRECORDS

Makes sure that in the extract file that is specified in the parameter <filename> any record that exists after the record that is referred to with parameter <last record no> will be removed. The parameter <record size> represents the length for each record.

Input: <filename>, <record size>, <last record no>

Result: <spaces> | <error message>

SPLITINTORECORDS

To splitup long strings of a file into separate strings.
This can be useful, because it is not possible in AMT to read files with a recordlength that exceeds 4000 bytes.

The recordsize must be known in the function. The original file can contain more than one record.

Input : <original filename>,<recordsize>,<newfilename>

Result: <spaces> | <error message>

Example:


WRITEFILE

To create a file from SI-PARAM in screen logic
If recordsize is -1 then the <CR><LF> are not translated otherwise all records in the file will get the specified length.

Input : <filename>,<recordsize>,<content>

Result: <spaces> | <error message>

Example: