declaration of varibale is not working

0 votes
asked Dec 8, 2019 in Bug by narus (120 points)

It seems that declaration of variable is not working :/

@startuml
$ab = "foo1"
$cd = "foo2"
global $ef = $ab + $cd

Alice -> Bob : $ab
Alice -> Bob : $cd
Alice -> Bob : $ef
@enduml

sth like above gives:

[From string (line 4) ]
                       
@startuml              
$ab = "foo1"           
$cd = "foo2"           
global $ef = $ab + $cd 
^^^^^                  
 Syntax Error?  

1 Answer

0 votes
answered Dec 8, 2019 by plantuml (226,800 points)

The correct syntax is

@startuml
!$ab = "foo1"
!$cd = "foo2"
!global $ef = $ab + $cd

Alice -> Bob : $ab
Alice -> Bob : $cd
Alice -> Bob : $ef
@enduml

It works better this way :-)

...