Book a Demo

Author Topic: Class Diagram  (Read 3073 times)

pinnacle_man

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Class Diagram
« on: September 24, 2002, 08:01:07 am »
hi everyone
could someone please tell me, how i can create a method in class diagram with optional parameter in it?
Thank you

mbc

  • EA User
  • **
  • Posts: 237
  • Karma: +1/-0
  • Embedded software developer
    • View Profile
Re: Class Diagram
« Reply #1 on: September 25, 2002, 03:35:24 am »
If I understand your question correctly, you want to add an operation to a class, and this operation should have a parameter, which is optional.
You do this by filling in a value in the "Default" field on the Parameters page of the Operations dialog box.

In C++ this generates the declaration shown below, when Param2 has a default value of 117:

void MyFunction(int Param1, int Param2 = 117);

I hope it helps
Mikkel

pinnacle_man

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Class Diagram
« Reply #2 on: September 25, 2002, 04:11:14 am »
Sorry, I tried with "Optional" in default field but its gave me error.
Any other solution?
Here is an example what I am after(in VB):

Public Sub Add (lngID as Long, Optional strType as String)
....
....
End Sub

Thank you for your kind help.
« Last Edit: September 25, 2002, 04:23:35 am by pinnacle_man »