June 26, 2008 - WinTask - Undocumented Workarounds
As with any tool, there are a few undocumented problems and limitations in WinTask.

Here are some that I know about. I'll add more as I learn of them.
#ScriptAfterTimeout$
#ScriptAfterTimeout$ does not allow you to use a .rob file name containing a space. It works correctly if the .rob doesn't contain any spaces in the file name.
So this will not work:
#ScriptAfterTimeout$="After Timeout" #ExecTimeout = 20
Pause 30 secs MsgBox("Ok")
WinTask Tech Support says that the " needs to be doubled:
The " needs to be doubled, so try:
#ScriptAfterTimeout$=chr$(34)+"After Timeout"+chr$(34)
and it will work.
Capture$
The argument in the Capture$() function cannot be a variable. It must be a constant.
So something like this will not work
var = 0 Capture$("window name",1,var)
It will get the following syntax error:
A number is expected
As a workaround, you could create a function like this and use it in place of Capture$:
Function MyCapture$(window_name$, instance, mode)
Local a$ Select Case mode Case 0 a$=Capture$(window_name$, instance, 0) Case 1 a$=Capture$(window_name$, instance, 1) Case 3 a$=Capture$(window_name$, instance, 3) Case 5 a$=Capture$(window_name$, instance, 5) Case 7 a$=Capture$(window_name$, instance, 7) Case 9 a$=Capture$(window_name$, instance, 9) Case Else a$=Capture$(window_name$, instance, 0) EndSelect MyCapture$=a$
EndFunction
MsgFrame
MsgFrame() cannot display an ampersand (&) as part of the text.
So, MsgFrame("A&B",1) will just display "AB"
WinTask Tech Support says to use two & characters instead of one
In the Windows control which is used for MsgFrame/MsgFrameTitle, the & is a special character (keyboard shorcut underlined). So to force the display of this character, you need to double the &
MsgFrame("A&&B",1)
MsgFrameTitle
MsgFrameTitle() cannot display an ampersand (&) as part of the text.
So, MsgFrameTitle("The Title","A&B",1) will just display "AB"
WinTask Tech Support says to use two & characters instead of one
In the Windows control which is used for MsgFrame/MsgFrameTitle, the & is a special character (keyboard shorcut underlined). So to force the display of this character, you need to double the &
MsgFrameTitle("The Title","A&&B",1)
Do you know of any undocumented WinTask problems and/or workardounds? Email Me
|