User Rod Ball (rball@agti.com.nospam) posted:

I am trying to use Test Script Options with robot. I am able to get the
values out correctly most of the time but it sometimes will return the
wrong length for the string and I will get a lot of extra garbage on the
end (and it is reproducible). In order to get them out I am doing the
following:

Declaring the following functions:

Declare Function TSSGetScriptOption Lib "rttss.dll" (ByVal optionName$)
As Long
Declare Function Dplstrlen Lib "kernel32" Alias "lstrlenA" (ByVal
lpString As Long) As Long
Declare Function Dplstrcpy Lib "kernel32" Alias "lstrcpyA" (ByVal
lpString1 As String, ByVal lpString2 As Long) As Long

Then using the following to get the "test" option:

Dim lString As Long
Dim lLength As Long
Dim sValue As String

lString = TSSGetScriptOption("test")
lLength = Dplstrlen(lString)
sValue = space(lLength + 1)
Dplstrcpy sValue, lString
sValue = Left$(sValue, InStr(sValue,Chr$(0)) - 1)

What happens is I am expecting to get the value of "Startup" and am
getting "Startup{BS}[22.24.3.1]:TaskSetOption not implemented in
tseagap" where {BS} is an actually the backspace character (Asc(8)). I
haven't seen a problem retrieving the first option only options after
the first option (note: I haven't seen this myself doesn't mean it won't
happen), and it doesn't always happen on options after the first option,
only some of them. Am I doing something wrong? Is there a better way
to do this?

Thanks,
Rod Ball


---