hex or decimal name of a task?

Discuss RoboTask here
Post Reply
wildrems
Posts: 16
Joined: Thu Jun 01, 2006 12:29 pm
Location: Canada

hex or decimal name of a task?

Post by wildrems »

hi everyone,
in a past post, oleg said it is possible to use the command line to execute a task, you simply need to use the name of the task in hex or decimal.
my question is, how do i know the name of the task in hex or decimal?
thanks
Oleg
Site Admin
Posts: 3201
Joined: Thu Jan 01, 1970 1:00 am
Contact:

hex or decimal name of a task?

Post by Oleg »

It is not documented. When you do "Create shortcut on desktop", RoboTask forms the command line automatically.
wildrems
Posts: 16
Joined: Thu Jun 01, 2006 12:29 pm
Location: Canada

hex or decimal name of a task?

Post by wildrems »

hi oleg,
ok, so a create a shortcut from RT. then a look a the name in the properties of the shortvut and i take the name in hex. it's a complicated process, but i will have to deal with it. so thanks for your answer.
 
Oleg
Site Admin
Posts: 3201
Joined: Thu Jan 01, 1970 1:00 am
Contact:

hex or decimal name of a task?

Post by Oleg »

Ok, we'll add menu item for generating of command line for selected task in next release.
wildrems
Posts: 16
Joined: Thu Jun 01, 2006 12:29 pm
Location: Canada

hex or decimal name of a task?

Post by wildrems »

hey oleg,
that is a great idea.
have a good day.
dennis2003a
Posts: 2
Joined: Wed Nov 21, 2007 11:14 am

hex or decimal name of a task?

Post by dennis2003a »

'*********************************************************** ************************************
' Simple workaround the Get the logfile
' This code will make a Variable For RoboTask {GET_LOG_FILE} witch contains the proper logname....
'*********************************************************** ************************************
' API to retrieve the current Threadid
Public Declare Function GetCurrentThreadId Lib "kernel32" () As Long
'Main events that have to be executed for errorhandling
Sub Main()
    Dim Cnt As Long
    Dim ThreadId As Long
    Dim ThreadName As String
    Dim Exname As String
   '**Comment : Could be used to create a standalone logfile or comment the if statement to create logfiles for al tasks that are loaded in robotask
    For X = 0 To RoboTaskApp.TaskCount - 1
        RoboTaskApp.TaskInfo( X, Exname, ThreadName, ThreadId )
        If (Exname = RoboTaskApp.ExternalName(GetCurrentThreadId)) Then
        '**Comment above line
             RoboTaskApp.SetUserVariable("Logfile" +"_" + ThreadName, sDecToHex(CStr(ThreadId))+".log")
        '**Comment underneed line
        End If
    Next
End Sub
'Converting Decimal to Hexadecimal and return it as a string to fill the variable GET_LOG_FILE_ENVIROMENT_SCRIPT
Public Function sDecToHex(ByVal nSource As Double) As String
    Const BASECHAR As String = "0123456789ABCDEF"
    Dim n As Double
    Dim nSrc As Double
    If (nSource = 0) Then
        sDecToHex = "00"
        Exit Function
    End If
    If (nSource < 2147483648#) Then
        sDecToHex = Hex(nSource)
    Else
        nSrc = nSource
        Do
              n = CDec(nSrc - (16 * Int(nSrc / 16)))
              sDecToHex = Mid$(BASECHAR, n + 1, 1) & sDecToHex
              nSrc = CDec(Int(nSrc / 16))
        Loop While (nSrc > 0)
    End If
    If (Len(sDecToHex) Mod 2) Then sDecToHex = "0" & sDecToHex
     Exit Function
End Function
Post Reply