home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / SCREDIT2.ZIP / SKELETON.P < prev    next >
Encoding:
Text File  |  1989-03-02  |  4.2 KB  |  200 lines

  1. {----------------------------------------------------------------------------
  2.                         Turbo ScrEdit Skeleton v.1.0
  3.  
  4.                        for Turbo Pascal 3.0, 4.0, 5.0
  5.  
  6. Refer to SKELETON.DOC for a complete discussion on the contents and usage
  7. of this file.
  8.  
  9. ----------------------------------------------------------------------------}
  10.  
  11. {---**Version**---}
  12.  
  13. {---**Buffers**---}
  14.  
  15.  
  16. {----**User Variables**----}
  17.  
  18. Var
  19.     Load_Screen_No      : Integer;
  20.     Demo_Screen_Pointer : Byte;
  21.     Demo_Mode,
  22.     Demo_Current_Screen : Integer;
  23.     Demo_Message        : String [80];
  24.  
  25.  
  26.  
  27. {----** Example of loading and displaying screens**----}
  28.  
  29. Procedure Load_Screen;
  30. Begin
  31. S_Num := 0;
  32. Repeat
  33.     Demo_Screen_Pointer := Demo_Screen_Pointer + 1;
  34.     Case Demo_Screen_Pointer of
  35.  
  36. {---**Screens**---}
  37.  
  38.     Else
  39.         Demo_Screen_Pointer := 0;
  40.     End;{Case Of}
  41. Until S_Num > 0;
  42. End;
  43.  
  44.  
  45. Procedure Initialize_Program;
  46. Begin
  47. S_Init;{<== YOU MUST ALWAYS CALL S_INIT BEFORE USING TURBO SCREDIT PROCEDURES}
  48. {---**ScreenFileName**---};
  49.  
  50. {---**InitRoutines**---}
  51.  
  52. {----**System Switches**----}
  53.  
  54. S_Sound      := True;
  55. S_Freq       := 300;
  56. S_Dur        := 100;
  57. S_ShowStatus := True;
  58. S_Cursor     := S_Normal;
  59. S_Point      := 0;
  60. S_Msg        := '';
  61.  
  62. {----** 1st Example Code **----}
  63.  
  64. Demo_Screen_Pointer := 0;
  65. Demo_Mode           := 1;
  66. Load_Screen;
  67.  
  68. End;
  69.  
  70.  
  71. Procedure Process_Screen_File;
  72. Begin
  73.  
  74.  
  75. {----** Demo mode 2 **----}
  76.  
  77. If  Demo_Mode = 2 Then
  78.     Repeat
  79.         S_Point := S_Point + 1;
  80.         While (S_Point = 0) Or (S_Field^.S_Type[S_Point] > 9) Do
  81.             Begin
  82.             S_Point := S_Point + 1;
  83.             If  S_Point > S_Indx^.S_Count[S_Num] Then
  84.                 S_Point := 0;
  85.             End;
  86.         If  S_Msg = '' Then
  87.             Begin
  88.             Str(S_point:3,S_Msg);
  89.             S_Msg := 'Field <' + S_Msg+ '>';
  90.             End;
  91.         S_READFIELD;
  92.         S_Msg := '';
  93.     Until (S_Alt) Or (S_Ctrl) Or (S_Fkey) Or (S_Enter);
  94.  
  95.  
  96. {----** Demo mode 0 or 1 **----}
  97.  
  98. If  (Demo_Mode <> 2) Then
  99.     S_ReadScreen;
  100.  
  101.  
  102. {----** Example code for demonstration mode **----}
  103.  
  104. If  (S_F1) And (Demo_Mode > 0) Then
  105.     Begin
  106.     S_Msg := 'Press any key to load the next screen';
  107.     S_ReadKey;
  108.     Load_Screen;
  109.     End;
  110.  
  111. {----**Special Key Testing**----}
  112.  
  113. If  S_Ch > #00 Then
  114.     S_Msg := '<' + S_Ch + '> '
  115. Else
  116.     Begin
  117.     S_Msg        := '';
  118.     S_Msg := '';
  119.     End;
  120.  
  121. If  S_Shift Then
  122.     Begin
  123.     If  S_LeftShift Then
  124.         S_Msg := '<Left Shift>' + S_Msg;
  125.     If  S_RightShift Then
  126.         S_Msg := '<Right Shift>' + S_Msg;
  127.     End;
  128.  
  129. If  S_Alt then
  130.     S_Msg := '< Alt  >' + S_Msg;
  131.  
  132. If  S_Ctrl then
  133.     S_Msg := '< Ctrl >' + S_Msg;
  134.  
  135. If  S_Esc   Then
  136.     S_Msg := '<Escape>' + S_Msg;
  137.  
  138. If  S_ENTER then
  139.     S_Msg := '<Enter >'  + S_Msg;
  140.  
  141. If  S_Fkey Then
  142.     Begin
  143.     If  S_F1 Then
  144.         S_Msg := S_Msg + 'F1key ';
  145.     If  S_F2 Then
  146.         S_Msg := S_Msg + 'F2key ';
  147.     If  S_F3 Then
  148.         S_Msg := S_Msg + 'F3key ';
  149.     If  S_F4 Then
  150.         S_Msg := S_Msg + 'F4key ';
  151.     If  S_F5 Then
  152.         S_Msg := S_Msg + 'F5key ';
  153.     If  S_F6 Then
  154.         S_Msg := S_Msg + 'F6key ';
  155.     If  S_F7 Then
  156.         S_Msg := S_Msg + 'F7key ';
  157.     If  S_F8 Then
  158.         S_Msg := S_Msg + 'F8key ';
  159.     If  S_F9 Then
  160.         S_Msg := S_Msg + 'F9key ';
  161.     If  S_F10 Then
  162.         S_Msg := S_Msg + 'F10key ';
  163.     If  S_Esc Then
  164.         S_Msg := S_Msg + 'Escape Key ';
  165.     If  S_Home Then
  166.         S_Msg := S_Msg + 'Home ';
  167.     If  S_Up Then
  168.         S_Msg := S_Msg + 'Up Arrow ';
  169.     If  S_PgUp Then
  170.         S_Msg := S_Msg + 'Page Up ';
  171.     If  S_Left Then
  172.         S_Msg := S_Msg + 'Left ';
  173.     If  S_Right Then
  174.         S_Msg := S_Msg + 'Right ';
  175.     If  S_End Then
  176.         S_Msg := S_Msg + 'End ';
  177.     If  S_Down Then
  178.         S_Msg := S_Msg + 'Down Arrow ';
  179.     If  S_PgDn Then
  180.         S_Msg := S_Msg + 'Pagedn ';
  181.     If  S_Ins Then
  182.         S_Msg := S_Msg + 'Insert key ';
  183.     If  S_Del Then
  184.         S_Msg := S_Msg + 'Delete ';
  185.     If  S_Tab Then
  186.         S_Msg := S_Msg + 'Tab ';
  187.     End;
  188.  
  189. End;
  190.  
  191. Begin
  192. Initialize_Program;
  193. Repeat
  194.     Process_Screen_File;
  195. Until S_Esc;
  196.  
  197. {----** Closing the Screen file **----};
  198. S_CloseScreenFile;
  199. End.
  200.