11-08-2016 04:03 AM
Does someone know how to write to stdout within a VBScript in DIAdem?
The following is not supported in DIAdem (also see http://zone.ni.com/reference/en-XX/help/370858M-01/scripting/methods/scripting_method_getstandardstr...😞
Dim fso, oTextStream
fso = CreateObject("Scripting.FileSystemObject")
oTextStream = fso.GetStandardStream(1, FALSE)
oTextStream.WriteLine("This is a test.")
oTextStream.Close
Something like WScript (http://ss64.com/vb/stdoutwrite.html) is also not working.
I need to write the status of DIAdem processing to stdout to make it accessible via commandl line (continuous integration server).
11-08-2016 05:57 AM - edited 11-08-2016 05:59 AM
A solution I have seen:
Option Explicit call WriteLineShared("C:\temp\out.txt", "Hello from DIAdem") sub WriteLineShared(byref filePath, byref content) dim fh : fh = TextFileOpen(filePath, eTextFileAttributeWrite or eTextFileAttributeDenyNone or eTextFileAttributeANSI) call TextfileWriteLn(fh, content) call TextFileClose(fh) end sub
Use the TextFileOpen method to open a file in shared mode. Allow reading from other processes while file is written.
Afterwards you can use a command like Tail.exe from unix tools to trace the output to the command line.
tail.exe -f "C:\temp\out.txt"
11-08-2016 06:21 AM
Hi,
I'm using also this one:
Call MsgLineDisp("Start of the script") Call LogfileDel() Call LogfileWrite(Str(CurrDateTimeReal, "#YYYY-mm-DD HH:NN:SS ampm")) Call LogfileWrite("Start of the script") Call LogfileBrowser()
First one is display in the left bottom corner of the DIAdem current status of script execution and LogfileWrite writes into the LOG file whatever you want. Then you can call for this LOG (open it) using LogfileBrowser or save it somewhere to have further access.
11-09-2016 09:58 AM
Ok, so there's no solution to directly write to console in DIAdem.
Thanks for the work-arounds nevertheless!
11-09-2016 02:14 PM
In additional there is
dbm "Hello"
which writes an Debug String to debug out.
But like most Windows applications std::out can not be captured by cmd.
Just console applications can do this directly.