FileDeleteWC Script Function

The Wonderware® InTouch™ script function FileDeleteWC() takes a given
directory path, along with a given filename (including wildcard characters
(example: ABC???.*)) and it will delete the specified file(s) under the
specified directory. FileDeleteWC() is a quick and easy way to delete one or
more specified files from within an InTouch application. The given directory
path and files can reside either on the local node or a remote node.


FileDeleteWC() will return value a of one (‘1’) if it is successful or a zero
(‘0’) if it fails. FileDeleteWC() will skip any sub-directories in the given
path—only files will be deleted. If a file has read-only properties or it is
hidden, then FileDeleteWC() will fail.


Installing the FileDeleteWC() Function


Download
the WWDlte32.zip file for Windows NT
from the Wonderware Knowledge Base.


Unzip the file that you downloaded and move the files WWDELETE.DLL,
WWDELETE.WDF and README.TXT to your InTouch directory.

Using the FileDeleteWC() Function


Format:


<Integer_tag> = FileDeleteWC(
“<Dir_Path>\<File>” );


Where <Integer_tag> is a valid InTouch Integer tagname,
<Dir_Path> is the given directory path, and <File> is
the given filename to delete.


Here are some examples of using FileDeleteWC():


DeleteFlag = FileDeleteWC(C:/MyDir/ABC??.*);
DeleteFlag =
FileDeleteWC(C:\MyDir\MyDir1\*.*);
DeleteFlag =
FileDeleteWC(C:\MyDir\MyDir2\*.LOG);
DeleteFlag =
FileDeleteWC(\\NODE1\DIRA\ABC??.*);

Leave a Reply

Your email address will not be published. Required fields are marked *

41 − = 34