check.pp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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.1 2004-12-29 21:39:53 armin
  40. * changed makefile version to 1.9.6, added samples for Netware
  41. }