Hi,
I'm getting to grips with run-time errors in my effort to port the Jaws
scripts for Sonar to Window Eyes, but I'm baffled as to what is happening in
the code I've listed below. If an MDIChild window exists, then all is well
and I get the results I expect, but the function returns an empty string
when an error is encountered (i.e. when no MDIChild window is present).
This seems to indicate that the condition (If Err.Number > 0 Then) is
operating correctly, so why isn't the assignment working (GetNowTime = "No
project open")?
Function GetNowTime
Dim myClips
Dim clipObj
GetNowTime = ""
'Get all the clips for the active window
On Error Resume Next
Set myClips = ActiveMDIChild.Clips(1)
If Err.Number > 0 Then
GetNowTime = "No project open"
Else
For Each clipObj In myClips
If TypeName(clipObj) <> "Empty" Then
If clipObj.Type = ctText Then
Dim firstChar : firstChar =
Asc(Left(clipObj.Text, 1))
If firstChar > 47 And firstChar < 58 Then '
Make sure it's a digit
If clipObj.FontStyle = fsBold And
clipObj.FontSize > 24 Then ' Make sure it's big bold text
GetNowTime = clipObj.Text
End If
End If
End If
End If
Next
End If
End Function
Best wishes.
Tim Burgess
Raised Bar Ltd
PO Box 4442
Atherstone
Warwickshire
CV9 9AT
Phone: +44 (0)1827 719822
Email: [EMAIL PROTECTED]
Web: http://www.raisedbar.net
Don't forget to vote for improved access to music and music technology at
http://www.raisedbar.net/petition.htm