Using Xpression version 9.5
I like to make utility functions when some task needs to be done again and again. In this case I am enabling/disabling tracks in scene directors.
However, when I try to access a track that doesn't exist, xpDbgMon.exe throws an alert box/notification.
This is the function:
Sub SetTrack(SDir as xpSceneDirector, Name as String, OnOff as Boolean)
Dim Track as xpSceneDirectorTrack
Try
SDir.GetTrackByName(Name,Track)
Track.Enabled=OnOff
Catch
'Do Nothing
End Try
End Sub
I thought the Try/Catch would suppress the message. I would also hope an error like this would show in the log. It doesn't.
I initially used the following but I got the alerts.
Sub SetTrack(SDir as xpSceneDirector, Name as String, OnOff as Boolean)
Dim Track as xpSceneDirectorTrack
If SDir.GetTrackByName(Name,Track) Then
Track.Enabled=OnOff
End If
End Sub
I solved the problem by adding an empty track with the missing name in the offending scene director. But I thought the way I was writing the code would suppress the alerts.
Any thoughts?
------------------------------
Azathoth
Son of Cthulhu
------------------------------