home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / tot5.zip / DEMIO3.PAS < prev    next >
Pascal/Delphi Source File  |  1991-02-11  |  3KB  |  138 lines

  1. program DemoIOThree;
  2. {demIO3 - every input field type!}
  3.  
  4. Uses DOS, CRT,
  5.      totFAST, totIO1, totIO2, totIO3, totDATE, totINPUT;
  6.  
  7. Var
  8.    MyList: array [1..10] of string[20];
  9.    Comments: array [1..8] of string[35];
  10.  
  11.    Str: StringIOOBJ;
  12.    Lat: LateralIOOBJ;
  13.    Pic: PictureIOOBJ;
  14.    Int: IntIOOBJ;
  15.    Rea: RealIOOBJ;
  16.    Fix: FixedRealIOOBJ;
  17.    Hx:  HexIOOBJ;
  18.    Dat: DateIOOBJ;
  19.    Check: CheckIOOBJ;
  20.    Radio: RadioIOOBJ;
  21.    WW: WWArrayIOOBJ;
  22.    Lis: ArrayIOOBJ;
  23.    AltX: HotkeyIOOBJ;
  24.    Keys: ControlkeysIOOBJ;
  25.    Strip: StripIOOBJ;
  26.    Strip3D: Strip3dIOOBJ;
  27.    Butt: ButtonIOOBJ;
  28.  
  29.    Manager: FormOBJ;
  30.    Result: tAction;
  31.  
  32. procedure FillArrays;
  33. {}
  34. begin
  35.    MyList[1] := 'French Fries';
  36.    MyList[2] := 'Baked Potato';
  37.    MyList[3] := 'Potato Salad';
  38.    MyList[4] := 'Coleslaw';
  39.    MyList[5] := 'Salad';
  40.    MyList[6] := 'Rice';
  41.    MyList[7] := 'Bark Chips';
  42.    MyList[8] := 'Tofu';
  43.    MyList[9] := 'Mixed Vegetables';
  44.    MyList[10] := 'Beer';
  45.    fillchar(Comments,sizeof(Comments),#0);
  46.    Comments[1] := 'This is the finest Pizza I have ';
  47.    Comments[2] := 'ever tasted. I also thought ';
  48.    Comments[3] := 'the head waiter was ';
  49.    Comments[4] := 'charming. ';
  50. end; {FillArrays}
  51.  
  52. procedure InitVars;
  53. {}
  54. begin
  55.    Str.Init(20,3,10);
  56.    Str.SetLabel('StringIOOBJ');
  57.    Lat.Init(20,4,20,40);
  58.    Lat.SetLabel('LateralIOOBJ');
  59.    Pic.Init(20,5,'(###) ###-####');
  60.    Pic.SetLabel('PictureIOOBJ');
  61.    Int.Init(20,6,10);
  62.    Int.SetLabel('IntIOOBJ');
  63.    Rea.Init(20,7,10);
  64.    Rea.SetLabel('RealIOOBJ');
  65.    Fix.Init(20,8,8,4);
  66.    Fix.SetLabel('FixedRealIOOBJ');
  67.    Hx.Init(20,9,5);
  68.    Hx.SetLabel('HexIOOBJ');
  69.    Dat.Init(20,10,MMDDYY);
  70.    Dat.SetLabel('DateIOOBJ');
  71.    with Check do
  72.    begin
  73.       Init(5,12,20,5,'CheckIOOBJ');
  74.       AddItem('Pepperoni',0,false);
  75.       AddItem('Mushrooms',0,true);
  76.       AddItem('Peppers',0,false);
  77.       AddItem('Dolphin',0,true);
  78.    end;
  79.    with Radio Do
  80.    begin
  81.       Init(5,18,20,4,'RadioIOOBJ');
  82.       AddItem('Thin Crust',0,false);
  83.       AddItem('Deep Pan',0,false);
  84.       AddItem('Hand Tossed!',0,true);
  85.    end;
  86.    Lis.Init(30,12,22,8,'ArrayIOOBJ');
  87.    Lis.AssignList(MyList,10,20);
  88.    WW.Init(40,6,37,5,'WWArrayIOOBJ');
  89.    WW.AssignList(Comments,8,35);
  90.    WW.WrapFull;
  91.    Strip.Init(60,13,'   ~O~K   ',Finished);
  92.    Strip.SetHotKey(280); {Alt-O}
  93.    Strip3d.Init(60,15,' ~C~ancel ',Escaped);
  94.    Strip3d.SetHotKey(302); {Alt-C}
  95.    Butt.Init(60,17,' ~B~utton ',Stop1);
  96.    Butt.SetHotKey(304); {Alt-B}
  97.    AltX.Init(301,Stop2);
  98.    Keys.Init;
  99. end; {InitVars}
  100.  
  101. begin                          
  102.    ClrScr;
  103.    Screen.TitledBox(1,1,80,25,76,79,78,2,' The Works! ');
  104.    Screen.WriteCenter(25,white,'Press TAB to switched fields and press ESC or F10 to end');
  105.    FillArrays;
  106.    InitVars;
  107.    with Manager do
  108.    begin
  109.       Init;
  110.       AddItem(Keys);
  111.       AddItem(Str);
  112.       AddItem(Lat);
  113.       AddItem(Pic);
  114.       AddItem(Int);
  115.       AddItem(Rea);
  116.       AddItem(Fix);
  117.       AddItem(Hx);
  118.       AddItem(Dat);
  119.       AddItem(Check);
  120.       AddItem(Radio);
  121.       AddItem(Lis);
  122.       AddItem(WW);
  123.       AddItem(Strip);
  124.       AddItem(Strip3d);
  125.       AddItem(Butt);
  126.       AddItem(AltX);
  127.       Mouse.Show;
  128.       Key.SetDouble(False);
  129.       Result := Go;
  130.       Mouse.Hide;
  131.       if Result = Finished then
  132.          {update the database..}
  133.       else
  134.          {call Esc routine};
  135.    end;
  136. end.
  137.  
  138.