[b]IDE Script Compile Error[/b]
Compiler error [180] Error found while compiling on line 1. Continue?
Line 1 is:
Dim s As New Shell
and line 2 is (just in case someone believe the line number is 0-based):
Dim header As String
(this line works fine on his own, alone)
The shell usage is:
s.Execute("date")
header = header + s.Result
Removed questions I found answers while continuing my quest.
Try
dim theResult as String = doCommand("date")
instead. There is no shell for IDE scripts.
Thank you Beatrix.
Of course, it do not works in that case.
Compiler error [67] Error found while compiling on line 3. Continue?
Bad day for me.
Sorry, my bad. That comes from typing from memory:
dim theResult as String
theResult = doShellCommand("date")
print theResult
Thanks Beatrix.
This answer comes far before (~30 minutes) I found it by myself (two minutes ago), by pure hazard.
I just get an ending EndOfLine, but I am near the end.
My script (adapted from the LR):
Dim command As String
command = “date”
Dim result As String
result = DoShellCommand(command)
BTW: I found a list of errors at some moment in my search, and I lost it
Code that fit my needs:
[code] Dim command As String
Dim result As String
command = “date ‘+%Y-%m-%d; %H:%M:%S’”
result = DoShellCommand(command)
result = Left(result, Len(result)-1)[/code]
The return date/time is:
2018-12-15; 12:24:49
Edit:
The last line remove the
at the end of the result string. It may have to be -2 on Windows due to platform differences
(for the EndOfLine character): not tested.
Nota: using uppercase Y (as above) returns the date using 4 digits (2018). Using the lowercase y will return only 2 digits (18).