omron — FindFile

Appendix: Built-in Scripting Language Syntax FileWrite( strFileName , strWriteText { | , optNumAppend } ) strFileName A string value enclosed in quotes, or the name of a String tag that contains the value, specifying the file name. By default, the file will be written in your project folder (i.e., the folder that contains the file project_name .APP ). To write in another folder, specify the complete file path. strWriteText A string value enclosed in quotes, or the name of a String tag that contains the value, specifying the text to be written to the file. optNumAppend A numerical value, or the name of an Integer tag that contains the value, specifying the text encoding of the file:

This is an optional parameter . If any value other than 0 through 3 is given, or if the parameter is not used, then 0 is the default. Returned value Examples FindFile FindFile is a built-in scripting function that searches for all files that match a given search string. Syntax FindFile( strFile { | ," optTagFilesFound " { | , optNumTimeout } } ) strFile The name of the file(s) to search for. You may use wildcards ( * ) to find multiple files. For example, *.gif to find all GIF files or log*.txt to find all log files in a sequence (e.g., log001.txt , log002.txt , log003.txt ).

By default, the function only searches the project folder, but you may specify a file path (either relative or absolute) to search elsewhere. For example, if strFile is defined as… \\ volume name or IP address \Logs\log*.txt Page 526 InduSoft Web Studio Value Description 0 Creates a new ASCII file with the given file name. If the file already exists, then it is overwritten. 1 Appends to an existing ASCII file with the given file name. If the file doesn't exist, then a new file is created. 2 Creates a new Unicode (UTF-16LE) file with the given file name. If the file already exists, then it is overwritten. 3 Appends to an existing Unicode file with the given file name.

If the file doesn't exist, then a new file is created. 0 Successful execution. −1 Invalid parameter(s). −2 Failed to open file. Disk is write protected or file name is invalid. Tag Name Expression Tag FileWrite( "c: est.txt", "This is a test" ) Tag FileWrite( strFileName, strWriteText ) Tag FileWrite( strFileName, strWriteText, 1 ) Function Group Execution Windows Embedded Thin Client FindFile File Synchronous Supported Supported Supported