Hi,
How do I write a message to the robotask log from a VBscript?
Adios,
Paulus
Write to robotask log from VBscript
Write to robotask log from VBscript
Use function WriteToLog(ByVal MsgType as integer, ByVal MessageStr as string, ByVal ThreadId as Long)
MsgType - Type of message
0 - Information
1 - warning
2 - error
MessageStr - message to write
ThreadId - Thread ID. You can get it by system function GetCurrentThreadId (see example below). When you pass an invalid "Tread ID" (for example 0) then message will be written to system RoboTask log. Also "Thread Id" is needed in ExternalName property.
Example script:
Declare Function GetCurrentThreadId Lib "kernel32" As Long
Sub Main
Dim i As Integer
Dim thr As Long
thr = GetCurrentThreadId
For i = 0 To 10
RoboTaskApp.WriteToLog(1 , Str(i), thr)
Next i
End Sub
MsgType - Type of message
0 - Information
1 - warning
2 - error
MessageStr - message to write
ThreadId - Thread ID. You can get it by system function GetCurrentThreadId (see example below). When you pass an invalid "Tread ID" (for example 0) then message will be written to system RoboTask log. Also "Thread Id" is needed in ExternalName property.
Example script:
Declare Function GetCurrentThreadId Lib "kernel32" As Long
Sub Main
Dim i As Integer
Dim thr As Long
thr = GetCurrentThreadId
For i = 0 To 10
RoboTaskApp.WriteToLog(1 , Str(i), thr)
Next i
End Sub
Last edited by Oleg on Wed Sep 29, 2004 8:31 am, edited 1 time in total.