Appearance
Windows File Functions
Flow provides functions for working with files, both as File Functions within the "Scripting Reference, Functions, File" section and also as Properties and Methods for the File Connection object class. Beyond that, you can use Flow to activate the Windows "FileSystemObject", as a COM object, to access the functionality that it provides.
The following example shows how to use Flow to interact with the Windows FileSystemObject. Full information is available from Microsoft and other pages on the Internet.
Example
pascal
procedure OnMapEvent(var Value:Variant);
var
fso: Variant; // COM objects are declared as type Variant
vFileName: string;
begin
fso := CreateOLEObject( 'Scripting.FileSystemObject' );
vFileName := 'C:\Temp\ToBeDeleted.txt';
if fso.FileExists( vFileName ) then
fso.DeleteFile( vFileName )
else
LogInfo('File "' + vFileName + '" was not found.');
end;