check.pp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. {
  2. $Id$
  3. This file is part of Free Pascal for Netware.
  4. Copyright (c) 1999-2002 by the Free Pascal development team.
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. Demonstrates the use of the check-function provided by the RTL
  11. **********************************************************************}
  12. {$MODE OBJFPC}
  13. {$Description Demo CheckFunction for FreePascal Netware-RTL}
  14. {$Version 1.0.0}
  15. {$Copyright (c) 2002 the FreePascal development team}
  16. { using crt automaticly calls _SetAutoScreenDestructionMode (TRUE);
  17. so no "Press any key to close screeen" will be shown by netware }
  18. uses crt;
  19. var first : boolean = true;
  20. procedure checkfunction (var res : longint);
  21. begin
  22. if first then
  23. begin
  24. ConsolePrintf (#13'It is unsafe to unload the nlm'#13#10);
  25. res := 1;
  26. end;
  27. first := false;
  28. end;
  29. begin
  30. WriteLn ('Press any key to unload nlm or unload via unload command');
  31. WriteLn ('The first unload should show a message that it is unsafe');
  32. WriteLn ('to unload the NLM, the second attempt should unload the');
  33. WriteLn ('NLM without a message.');
  34. System.NetwareCheckFunction := @checkfunction;
  35. ReadKey;
  36. end.
  37. {
  38. $Log$
  39. Revision 1.2 2002-09-07 16:01:21 peter
  40. * old logs removed and tabs fixed
  41. Revision 1.1 2002/03/30 09:12:15 armin
  42. + demo for netware check-funcktion
  43. }