!ifdef A || B

0 votes
asked Nov 21, 2016 in Wanted features by boshka (2,730 points)
is it possible to use OR condition in the !ifdef preprocessor command?

1 Answer

0 votes
answered Nov 22, 2016 by Serge Wenger Work (8,870 points)


Your proposal is interesting. I do this with a workaround:

'define A
!define B
!ifdef A
!define AorB
!ifdef B
!define AorB
!ifdef AorB
title A or B
Bob-> Alice
Hope this helps
commented Nov 22, 2016 by boshka (2,730 points)
many thanks!
commented Nov 22, 2016 by plantuml (164,580 points)
Very clever workaround!

However, I think we need a better solution.
So in last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

You can have things like:
!ifdef A || B
!ifdef A && B
!ifdef A && ( B || !C )

You can also use | & instead of || && (same meanings).

This has not been highly tested, so do not hesitate to do feedback.

commented Nov 22, 2016 by boshka (2,730 points)
Indeed a nice workaround. I used it since I must provide a backwards compatible solution. But anyway, many thanks for adding the new format too.