home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / oasis / samples / sample3.pas < prev    next >
Pascal/Delphi Source File  |  1987-12-12  |  3KB  |  72 lines

  1. {$R-}    {Range checking off}
  2. {$B+}    {Boolean complete evaluation on}
  3. {$S+}    {Stack checking on}
  4. {$I+}    {I/O checking on}
  5. {$N-}    {No numeric coprocessor}
  6. {$M 65500,16384,655360} {Turbo 3 default stack and heap}
  7.  
  8.  
  9. PROGRAM Stackdemo;
  10.  
  11.  
  12. uses scl;
  13.  
  14. PROCEDURE Scl_Defaults;
  15. BEGIN;
  16.   Beep_Time:=2;           {Beep shorter}
  17.   Auto_Help_Set:=FALSE;   {No autohelp in this program}
  18. END;
  19.  
  20. FUNCTION Up:BOOLEAN;
  21. BEGIN;
  22.   Up:=FALSE;
  23.   IF User_Function THEN   {user function key pressed}
  24.     BEGIN;
  25.       IF (Active_Field = 1) AND       {'Up' field}
  26.        (Char_Code = Code_Return) THEN { wants to select field}
  27.         BEGIN;
  28.           Up:=TRUE;
  29.           Char_Code:=Code_Noop;   { SCL should not do anything}
  30.         END;                      { with this input character,}
  31.     END;                          { i.e not mark the field as }
  32. END;                              { selected}
  33.  
  34.  
  35. PROCEDURE Do_Format(This_Name:String10;This_X,This_Y:INTEGER);
  36. VAR
  37.   N,
  38.   Next_Name:String10;
  39.   Next_X,
  40.   Next_Y   :INTEGER;
  41. BEGIN;
  42.   Select_Format(This_Name);          {load it from disk}
  43.   Display_Format(This_X,This_Y);     {display it }
  44.   Next_X:=This_X+2;          {increase displacements}
  45.   Next_Y:=This_Y+1;          {for the next format to be loaded}
  46.   REPEAT
  47.     Handle_Format;                   {handle this format}
  48.     IF Up THEN                       {user wants to go up}
  49.       BEGIN;
  50.         N:=Capital(This_Name);       {capital letters}
  51.         IF N =  'ONE'   THEN Next_Name:='Two'   ELSE {Which}
  52.         IF N =  'TWO'   THEN Next_Name:='Three' ELSE {format}
  53.         IF N =  'THREE' THEN Next_Name:='four'  ELSE {is}
  54.         IF N =  'FOUR'  THEN Next_Name:='Five'  ELSE {the}
  55.         IF N =  'FIVE'  THEN Next_Name:='Six'   ELSE {next}
  56.         IF N =  'SIX'   THEN Next_Name:='Seven' ELSE {one}
  57.         IF N =  'SEVEN' THEN Next_Name:='Eight' ELSE { ? }
  58.         IF N =  'EIGHT' THEN Next_Name:='Nine'  ELSE
  59.         IF N =  'NINE'  THEN Next_Name:='Ten';
  60.         Do_Format(Next_Name,Next_X,Next_Y);      {Recursive}
  61.      END;            {call with new name  and displacements}
  62.   UNTIL Format_Done; {this format is finished.}
  63. END; {of Do_Format}
  64.  
  65. BEGIN; {of main}
  66.   Select_Format_File('Sample3');   {initialize SCL and load}
  67.                                    {format file 'Sample2'}
  68.   Scl_Defaults;                    {change some SCL defaults}
  69.   Do_Format('one',0,0);            {display&handle format 'one'}
  70.   Close_Formats;                   {terminate SCL}
  71. END.  {of main}
  72.