You can write JavaScript using these utilities in the VWorks Advanced Settings area. For instructions on how to add the JavaScript task and display the Advanced Settings area, see
Where to write JavaScript.
The ActiveX Wrapper utility in the VWorks software allows you to use another product's ActiveX control to invoke the product's operations. Make sure you install the product's ActiveX control software before you run the JavaScript.
The ocx = new ActiveX statement passes the PlateLoc PROG_ID to the ActiveX object generator. Using the ID, the generator calls the CreateInstance API. The resulting ActiveX object is then wrapped in the scripting layer that translates arguments and returns values that are understood by both the PlateLoc Sealer and the
VWorks software.
The first var statement creates an ADO object and assigns it to a variable named db.
The second var statement creates an ADO command object and assigns it to a variable named comm.
The comm.set statement sets the ActiveConnection property to the connection object in the db variable.
fileobjectname is the name of the file object you created.
filepath (the first argument) is the location of the file you are creating. For example, you can type
c:\\fileobjectname.txt.
0 (the second argument) specifies how new information will be added to the file. 0 adds new information after the existing information. A non-zero value erases the existing file contents before adding the new information. If you do not specify this argument, the system will use the default value of 0.
0 (the third argument) specifies how the line endings in binary files will be translated. 0 translates line endings to a carriage return followed by a line feed. 1 does not translate the existing line ending. If you do not specify this argument, the system will use the default value of 0.
fileobjectname is the name of the file object you created.
fileobjectname is the name of the file object you created.
writeoutput is the string you want to add to the file.
\n adds a new line at the end of the string.
The var statement checks to see if the file opening call was successful.
filepath is the location of the file you are checking.
The var statement checks to see if the file exists in the specified folder and returns true if the file is present.
filepath is the location of the file you are deleting. For example, you can type
c:\\fileobjectname.txt.