1. %% Example of macro usage in Platypus.
  2. %%
  3. %% Comments are in green, commands in blue, text in black.
  4. %% To verify, hover the cursor over any colored element.
  5. %% -------------------------------------------------------
  6. %%
  7. %% Define the macros
  8. %%
  9. [def:BOBOTW{ bottles of beer on the wall, }]
  10. [def:BOB{ bottles of beer;}]
  11. [def:T1down{Take one down, pass it around, }]
  12. [def:Qty{99}]
  13. %%
  14. %% Print the text using the macros, redefining Qty, as you go
  15. %%
  16. [paraindent:0][paraskip:0li]
  17. [*Qty][*BOBOTW][*Qty][*BOB][]
  18. [*T1down][def:Qty{98}][*Qty][*BOB][]
  19. [*Qty][*BOBOTW][*Qty][*BOB][]
  20. [*T1down][def:Qty{97}][*Qty][*BOB][]
  21. [*Qty][*BOBOTW][*Qty][*BOB][]
  22. [*T1down][def:Qty{96}][*Qty][*BOB][]
  23. etc...

  24. [%% The resulting text is a formatted verison of:

  25. 99 bottles of beer on the wall, 99 bottles of beer;
  26. Take one down, pass it around, 98 bottles of beer;
  27. 98 bottles of beer on the wall, 98 bottles of beer;
  28. Take one down, pass it around, 97 bottles of beer;
  29. 97 bottles of beer on the wall, 97 bottles of beer;
  30. Take one down, pass it around, 96 bottles of beer;
  31. etc...

  32. %%]