"!pragma useVerticalIf on" not working

0 votes
asked Jan 24, 2023 in Bug by LP22 (120 points)

Hello (new here smiley ),

I made a graphic using "if" and I would have liked it to be arranged vertically.
So I used "!pragma useVerticalIf ​​on" but nothing changed.

Here is my code:

@startuml

!pragma useVerticalIf on

scale 1020x4000

start

if (L'étudiant est-il vu \n\n(écran ou présence physique) ?) then (<color:red>Non)

  #pink:Absent;

  kill

else (<color:green>Oui)

if (Le cours est-il hybride ?) then (<color:red>Non)

if (Retard de + de 15min ?) then (<color:red>Non)

  #palegreen:Présent;

  kill

else (<color:green>Oui)

  #pink:Retard;

endif

kill

 else(<color:Green>Oui)

if (Cours en présence du prof ?) then (<color:green>Oui)

  :Présent \nHybride Synchrone;

  kill

else (<color:red>Non)

  :Présent \nHybride Asynchrone;

  kill

@enduml

Do you know why this is not working?
Thanks in advance !

1 Answer

0 votes
answered Jan 24, 2023 by The-Lu (63,920 points)

Hello L., and all,

Welcome on this forum...

To better use `!pragma useVerticalIf on`, you must use `elseif` instead simple `else', as:

@startuml
!pragma useVerticalIf on
'scale 1020x4000
start
if (L'étudiant est-il vu \n\n(écran ou présence physique) ?) then (<color:red>Non)
  #pink:Absent;
  kill
(<color:green>Oui) elseif  (Le cours est-il hybride ?) then (<color:red>Non)
if (Retard de + de 15min ?) then (<color:red>Non)
  #palegreen:Présent;
  kill
else (<color:green>Oui)
  #pink:Retard;
endif
kill
(<color:Green>Oui) elseif (Cours en présence du prof ?) then (<color:red>Non)
  :Présent \nHybride Asynchrone;
  kill
else (<color:green>Oui)
  :Présent \nHybride Synchrone;
  kill
endif
@enduml

Enjoy,
Regards,
Th.

...