| Dettagli del download |
|
LogMessage is a project designed to demonstrate how to log a text string to a file from a script. The button located in the main visualization window is used to start the LogMessageTest script that contains the LogMessage procedure. This procedure is defined within the Define script (also the functions for custom date and time formatting are defined within this script). Access to the file is done via an object named "Scripting.FileSystemObject" (the OpenTextFile method of this object is used). If this method is called with the filename as a parameter, a new object is created (the numerical parameter defines the opening method, 1 – read only, 2 – write, 8 – append, and the logical parameter defines whether the file should be created if it doesn't exist). Now, you can call the WriteLine method of this object and write an arbitrary text string to the file. If the button located in the main visualization window is pressed at runtime, a new directory named Logs is created in the <Project> directory. The ScriptLog.txt file is created in this directory. The file contains lines with a current date, time, and example text string. |
|
|||||||||||||||||||||||||||||||||

Gli esempi presenti su questo sito sono stati liberamente inviati dagli utenti di automationforum.it, è stato espressamente specificato loro di inviare solo esempi FREE. Automationforum.it non si ritiene responsabile dell'eventuale presenza di esempi rilasciati sotto licenza commerciale, Automationforum.it invita tutti coloro che individuano esempi rilasciati sotto licenza commerciale presenti in questa raccolta a segnalarlo dall'apposito