18.01.2015 Views

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix: Built-in Scripting Language<br />

Value<br />

Description<br />

3 Appends to an existing Unicode file with the given file name. If the file doesn't exist, then a new file is created.<br />

This is an optional parameter. If any value other than 0 through 3 is given, or if the parameter is<br />

not used, then 0 is the default.<br />

Returned value<br />

0 Successful execution.<br />

−1<br />

−2<br />

Invalid parameter(s).<br />

Failed to open file. Disk is write protected or file name is invalid.<br />

Examples<br />

Tag Name<br />

Expression<br />

Tag FileWrite( "c: est.txt", "This is a test" )<br />

Tag FileWrite( strFileName, strWriteText )<br />

Tag FileWrite( strFileName, strWriteText, 1 )<br />

FindFile<br />

FindFile is a built-in scripting function that searches for all files that match a given search string.<br />

Function Group Execution Windows Embedded Thin Client<br />

FindFile File Synchronous Supported Supported Supported<br />

Syntax<br />

FindFile(strFile{ | ,"optTagFilesFound"{ | ,optNumTimeout } })<br />

strFile<br />

The name of the file(s) to search for.<br />

You may use wildcards (*) to find multiple files. For example, *.gif to find all GIF files or<br />

log*.txt to find all log files in a sequence (e.g., log001.txt, log002.txt, log003.txt).<br />

By default, the function only searches the project folder, but you may specify a file path (either<br />

relative or absolute) to search elsewhere. For example, if strFile is defined as…<br />

\\volume name or IP address\Logs\log*.txt<br />

…then the function will search the Logs directory on the specified network volume.<br />

optTagFilesFound<br />

An array (of String type) that will receive the names of the matching files. The array name must<br />

be enclosed in quotes; if it is not, then the function will try to get the contents of the array.<br />

This is an optional parameter. If no value is specified, then the file names will not be saved and<br />

the function will only return the number of files found. For more information, see "Returned<br />

value" below.<br />

optNumTimeout<br />

Note: The array will receive only the file names and not their paths, even if you<br />

define strFile to search outside the default directory.<br />

The timeout period (in milliseconds) for the function to be successfully executed.<br />

Page 632<br />

<strong>InduSoft</strong> Web Studio

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!