conditionalprefix.pp 872 B

1234567891011121314151617181920212223242526272829
  1. {
  2. This file is part of the Free Component Library
  3. Copyright (c) 2022 by Michael Van Canneyt, [email protected]
  4. Take a unit name and add a conditional define for a namespace.
  5. To be used in shell scripts or to be invoked from an editor
  6. that allows you to filter a selection through a command
  7. See the file COPYING.FPC, included in this distribution,
  8. for details about the copyright.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. **********************************************************************}
  13. program conditionalprefix;
  14. Var
  15. S : AnsiString;
  16. begin
  17. Readln(S);
  18. if S<>'' then
  19. S[1]:=UpCase(S[1]);
  20. S:='{$IFDEF FPC_DOTTEDUNITS}'+ParamStr(1)+'.{$ENDIF}'+S;
  21. Write(S);
  22. end.