home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 June / Chip_2002-06_cd1.bin / zkuste / delphi / nastroje / d123456 / DEBUGDEL.ZIP / testmain.pas < prev   
Encoding:
Pascal/Delphi Source File  |  2001-09-10  |  1.4 KB  |  66 lines

  1. UNIT testmain;
  2.  
  3. INTERFACE
  4.  
  5. USES
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls;
  8.  
  9. TYPE
  10.   TForm1 = CLASS( TForm )
  11.     Button1 : TButton;
  12.     PROCEDURE FormCreate( Sender : TObject );
  13.     PROCEDURE TuWas( Sender : TObject );
  14.     PROCEDURE FormDestroy( Sender : TObject );
  15.   PRIVATE
  16.     { Private declarations }
  17.     MyOutput : Text;
  18.   PUBLIC
  19.     { Public declarations }
  20.   END;
  21.  
  22. VAR
  23.   Form1 : TForm1;
  24.  
  25. IMPLEMENTATION
  26.  
  27. USES
  28.   DebugInterface;
  29.  
  30. {$R *.DFM}
  31.  
  32. PROCEDURE TForm1.FormCreate( Sender : TObject );
  33. BEGIN
  34.   // Extra File Variables are available in professional mode only
  35.   OpenAuxDebugOutput(MyOutput , 1);  // Channel 0 .. 9 possible (0 = Main)
  36. END;
  37.  
  38. PROCEDURE TForm1.TuWas( Sender : TObject );
  39. VAR
  40.   j         : Integer;
  41.   mess      : STRING;
  42.   lineno    : STRING;
  43. BEGIN
  44.   WriteLn('Main Channel used (-M-  =  MainChannel)');
  45.   WriteLn(DBChannel[1],'Minor Channel 1 used');
  46.   // Next two lines only displayed in professional mode
  47.   WriteLn(DBChannel[2],'Minor Channel 2 availlable in professional mode only');
  48.   WriteLn(MyOutput, 'Auxilary Channel used, allocated is channel 1');
  49.   Mess := '012345678|';
  50.   Mess := Mess + Mess;
  51.   Mess := Mess + Mess;
  52.  
  53.   FOR j := 0 TO 9 DO BEGIN
  54.     Str( j + 1, lineno );
  55.     WriteLn( lineno + '-' + mess );
  56.   END;
  57. END;
  58.  
  59. PROCEDURE TForm1.FormDestroy( Sender : TObject );
  60. BEGIN
  61.   CloseAuxDebugOutput(MyOutput);
  62. END;
  63.  
  64. END.
  65.  
  66.