UTILITY_DOTNET provides comparable functionality to the existing UTILITY function, but uses Microsoft .NET assemblies to provide this functionality using the latest operating system routines. By using the .NET assemblies, instead of Windows functions, UTILIY_DOTNET is also available to be used in non-UI contexts, such as O4W routines.
UTILITY_DOTNET has the following interface:
Function UTILITY_DOTNET(TYPE, PARAM1, PARAM2, PARAM3, PARAM4, STATUS)
where "TYPE" is the command you wish to execute; "PARAM1", "PARAM2", "PARAM3", and "PARAM4" are the (possibly optional) parameters required by the command; and "STATUS" is the returned status from the command.
The available TYPEs for UTILITY_DOTNET include:
CHECKWIN
COPYDIR
COPYFILE
GETWINHNDL
KILLWIN
MAKEDIR
MOVEDIR
MOVEFILE
REMOVEDIR
RUNWIN
TIMEZONE
UNZIP
ZIP
By default, UTILITY_DOTNET will use .NET 2.0 assemblies to execute these requests; however, if .NET 4.0 assemblies are desired, you may suffix the command with "4" - for example, RUNWIN4, CHECKWIN4, etc.
[Updated for OI10] By default, UTILITY_DOTNET will use .NET 4.0 assemblies to execute these requests; however, if .NET 2.0 assemblies are desired, you may suffix the command with "2" - for example, RUNWIN2, CHECKWIN2, etc.
CHECKWIN: Pass in the handle to the REVDOTNET object for the window you wish to check (PARAM1), as obtained by RUNWIN with PARAM4 = "1". Returns the literal "True" if the window has exited, or the literal "False" if the window is still running. Any error messages are returned in STATUS.
COPYDIR: Pass in the path to the original directory you wish to copy, and the path to the destination location. Any error messages are returned in STATUS.
COPYFILE: Pass in the path and filename to the original file you wish to copy, and the path and filename you wish to copy it to. Any error messages are returned in STATUS.
GETWINHNDL: Pass in the handle to the REVDOTNET object for the window you wish to check (PARAM1), as obtained by RUNWIN with PARAM4 = "1". Returns the window handle (which can then be used in other Windows calls). Any error messages are returned in STATUS.
KILLWIN: Pass in the handle to the REVDOTNET object for the window you wish to check (PARAM1), as obtained by RUNWIN with PARAM4 = "1", and a flag to indicate whether you wish to have the window closed (PARAM2 = 1) or killed without invoking the closing logic (PARAM2 = 0). Any error messages are returned in STATUS.
MAKEDIR: Pass in the full path to the directory you wish to create (PARAM1). Any error messages are returned in STATUS.
MOVEDIR: Pass in the path to the original directory you wish to move, and the path to the destination location. Any error messages are returned in STATUS.
MOVEFILE: Pass in the path and filename to the original file you wish to move, and the path and filename you wish to move it to. Any error messages are returned in STATUS.
REMOVEDIR: Pass in the full path to the directory you wish to remove (PARAM1). Any error messages are returned in STATUS.
RUNWIN: Pass in the command to run (PARAM1), the command line arguments (PARAM2), a flag to indicate whether UTILITY_DOTNET should wait for the command to complete (PARAM3), and a flag to indicate whether UTILITY_DOTNET should return the handle to the REVDOTNET object created (PARAM4). Returns null or the handle to the REVDOTNET object (if PARAM4 is "1"). Any error messages are returned in STATUS.
TIMEZONE: Pass in the DATETIME that you wish to "localize" (PARAM1), and the type of action you wish to perform on the DATETIME (PARAM2). If PARAM1 is null, the current DATETIME is used. If PARAM2 is null or "0", then the return value will be the DATETIME passed in PARAM1 formatted as a valid timezone string (in the format "ddd, dd MMM yyyy HH:mm:ss zz"); if PARAM2 is "1", then the return value will be the UTC offset of the DATETIME passed in PARAM1; if PARAM2 is -1, then the return value will be the DATETIME passed in PARAM1 converted into Universal Time. Any error messages are returned in STATUS.
UNZIP: Pass in the full path and file name of the zip file you wish to extract from (PARAM1), and the full path to the directory that you wish the unzipped files to be placed into (PARAM2). Any error messages are returned in STATUS.
ZIP: Pass in the full path and file name of the zip file to create (PARAM1), and the full path to the directory that contains the files you wish to zip (PARAM2). Any error messages are returned in STATUS.