Macro variable expansion

0 votes
asked Feb 27, 2014 in To be sorted by kreuzberger (220 points)
Hi! i am working on component diagrams and use your "beta" long macro feature. This works quite good.

No i want to add componentents and interfaces in the macro together with the macro variable.

!definelong COMP_TEXTGENCOMP(name)
  [name] << Comp >>
  interface Ifc << IfcTyoe >> AS "name Ifc"
  "name Ifc" - [name]
!enddefinelong

This gives errors, cause "name Ifc" seems not to identified as valid interface

How can i append the name macro variable? Like c syntax seems not to work: name##Ifc.

Thanks for help

5 Answers

0 votes
answered Feb 27, 2014 by anonymous
found out after many tries, that it seems to work with a simple dot.
so you can use the macro for generation e.g. of components with the same interface and an "instance" handle for this interfaces.

@startuml

!definelong COMP(name)
[name]
interface TestIfc as name.TestIfc
name.TestIfc - [name]
!enddefinelong

COMP(hello)
COMP(world)

@enduml
0 votes
answered Feb 28, 2014 by plantuml (294,960 points)

Hello,

Thanks for the suggestion.
In the following beta:
https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

You can use ## to concat macro arguments:
 
 @startuml
 !definelong COMP_TEXTGENCOMP(name)
 [name] << Comp >>
 interface Ifc << IfcTyoe >> AS name##Ifc
 name##Ifc - [name]
 !enddefinelong
 COMP_TEXTGENCOMP(dummy)
 @enduml


I think it is what you are looking for.

 

0 votes
answered Feb 28, 2014 by kreuzberger (220 points)
How can i find out in which release the feature from the beta will go in?

the feature with the definelong macro seems not be in the current release. So do i have to rely on the beta for this feature?
commented Feb 28, 2014 by plantuml (294,960 points)
The ## feature will be integrated in V7994, if it fits your need.

This is usually how we proceed : we publish a beta release, so that users can test it and validate that the new feature(s) is ok for them.

After their validation, we publish the official release with the feature(s).
0 votes
answered Mar 3, 2014 by kreuzberger (220 points)
The solution provided worked with the betra release. So it could be added in the next release version from my point of view.

Cause the feature depends on the definelog definition (for my special case here) if also works for me to have "this feature" enabled.

This seems also not be part of the "official" release? So could you please als provide this feature?
0 votes
answered Mar 3, 2014 by plantuml (294,960 points)

This has been released in V7994.

 

@startuml
!definelong COMP_TEXTGENCOMP(name)
[name] << Comp >>
interface Ifc << IfcTyoe >> AS name##Ifc
name##Ifc - [name]
!enddefinelong
COMP_TEXTGENCOMP(dummy)
@enduml

...