umacpas1.pp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. unit umacpas1;
  2. {$DEFINE UMACPAS_PRE_INTERFACE_VAR}
  3. {The above will _not_ be exported, unless it is redefined
  4. after the mode switch (which it is). Note the non-macpas
  5. style, because $mode macpas has not yet been parsed.}
  6. {$MODE MACPAS}
  7. interface
  8. {$SETC UMACPAS_COMP_VAR = TRUE}
  9. {The above macro is deliberatelly immediatelly after INTERFACE
  10. to check that this works.}
  11. {$SETC UMACPAS_PRE_INTERFACE_VAR = TRUE}
  12. {Is redefined here and thus exported..}
  13. {$IFC UMACPAS_COMP_VAR }
  14. {$NOTE UMACPAS_COMP_VAR is true}
  15. {$ELSEC}
  16. {$NOTE UMACPAS_COMP_VAR is false}
  17. {$ENDC}
  18. var
  19. a: Integer;
  20. {The below macro should be exported}
  21. {$SETC UMACPAS_PRE_IMPL_COMP_VAR = TRUE}
  22. implementation
  23. {$SETC UMACPAS_COMP_VAR = FALSE}
  24. {The above macro is deliberatelly immediatelly after IMPLEMENTATION
  25. to check that this works. Note that here UMACPAS_COMP_VAR is set to false,
  26. but the exported value of UMACPAS_COMP_VAR should nevertheless be TRUE. }
  27. {$Z+}
  28. var
  29. nisse: Integer;
  30. {To be available in tmacpas via the mode macpas $J directive}
  31. function Get84: Integer;
  32. {To be available in tmacpas via EXTERNAL}
  33. begin
  34. Get84:= 84;
  35. end;
  36. {$Z-}
  37. {$IFC UMACPAS_PRE_INTERFACE_VAR }
  38. {$NOTE UMACPAS_PRE_INTERFACE_VAR is true}
  39. {$ELSEC}
  40. {$ERRORC UMACPAS_PRE_INTERFACE_VAR is false}
  41. {Erroneous since it was set to true in the interface section.}
  42. {$ENDC}
  43. begin
  44. nisse:= 42;
  45. end.