I am loving PlantUML and have many lines of script.. As the number of lines of script grows, the overall effort to keep the diagrams consistent and standard gets difficult.
To assist, I am attempting to write a simple macro which works along the lines of a excel vlookup where you pass in a search string, a file name of what is to be searched and an offset value to be returned.
However i am struggling on my first attempt with a parsing error. I am hoping some fresh eyes can help.. or even better if someone in the plantuml community has already done something along these lines.
thank you,
David.
@startuml vlookup test
!preprocessorV2
!unquoted function $vlookup( $id, $range, $offset)
!log vlookup on $id
'!log vlookup on %get_variable_value("$id")
!$row1 = "cm|customer master|manages customers"
!$row2 = "tm|transaction manager|manages transactions"
!$row3 = "am|account manager|manages accounts"
'%set_variable_value("$row1", "cm|customer master|manages customers" )
'%set_variable_value("$row2", "tm|transaction manager|manages transactions" )
'%set_variable_value("$row3", "am|account master|manages accounts" )
!if ($id == "cm")
'!return %get_variable_value("$row1")
!return $row1
!endif
!if ($id == "tm")
'!return %get_variable_value("$row2")
!return $row2
!endif
!if ($id == "am")
'!return %get_variable_value("$row3")
!return $row3
!else
!return "error"
!endif
!endfunction
!$note = $vlookup("cm", "system.iuml", 1)
component comp1 [
$note
]
@enduml