Title:

Hi Sven

the following lines should work:

Sub ProcessStateMachine (aStateMachine As StateMachine)
        REM Do Something
End Sub

Sub ProcessClass(aClass As Class)
If aClass.StateMachine Is Not Nothing Then
        ProcessStateMachine aClass.StateMachine
End If
End Sub

Sub Main
   For i% = 1 To RoseApp.CurrentModel.GetAllClasses().Count
   ProcessClass RoseApp.CurrentModel.GetAllClasses().GetAt(i%)
   Next i%
End Sub

 
Best Regards,
René Meyer



-----Ursprungliche Nachricht-----
Von: sven biebaut [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 27. Juni 2001 14:00
An: roseforum
Betreff: (ROSE) REI checking for existance



hello all,

Can anyone tell me how to check for the validity of a property in a
script, f.i. when a REI method returns a class and that class is not
necessarily there in the model, how do i check this ?

Example :

    Sub ProcessStateMachine (aStateMachine As StateMachine)
    End Sub

    Sub ProcessClass(aClass As Class)
       ProcessStateMachine aClass.StateMachine
    End Sub

    Sub Main
       For i% = 1 To RoseApp.CurrentModel.GetAllClasses().Count
        ProcessClass RoseApp.CurrentModel.GetAllClasses().GetAt(i%)
       Next i%
    End Sub

Here i ask for the statemachine of a class, but not all classes have
one. How can i check that i only call processStateMachine on an existing
StateMachine.

I tried the other way round, but there is no such thing as a
'getallstatemachines' on a rosemodel.

Thanks in advance,

Sven Biebaut

************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Admin.Subscription Requests: [EMAIL PROTECTED]
* Archive of messages: http://www.rational.com/products/rose/usergroups/rose_forum.jtmpl
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*
* To: [EMAIL PROTECTED]
* Subject:<BLANK>
* Body: unsubscribe rose_forum
*
*************************************************************************

Reply via email to