home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 14 / CDACTUAL.iso / cdactual / demobin / share / program / Basic / STDLIB.ZIP / SYSINIT.BAS < prev    next >
Encoding:
BASIC Source File  |  1990-10-04  |  7.9 KB  |  286 lines

  1. '****************************************************************************
  2. 'Total Control Systems                                         QuickBasic 4.5
  3. '****************************************************************************
  4. '
  5. '  Program     : SYSINIT.BAS
  6. '  Written by  : Tim Beck
  7. '  Written On  : 10-01-90
  8. '  Function    : SYSINIT.BAS - INITIALIZE SYSTEM
  9. '
  10. '****************************************************************************
  11. '  This program and those associated with it were written for use with Quick-
  12. '  Windows Advanced (Version 1.5+).  Possesion of this program entitles you
  13. '  to certain priviliges.  They are:
  14. '
  15. '     1. You may compile, use, or modify this program in any way you choose
  16. '        provided you do not sell or give away the source code to this prog-
  17. '        ram or any of it's companions to anyone for any reason.  You may,
  18. '        however, sell the resulting executable program as you see fit.
  19. '
  20. '     2. You may modify, enhance or change these programs as you see fit. I
  21. '        as that you keep a copy of the original code and that you notify
  22. '        me of any improvements you make.  I like to think that the code is
  23. '        bug free and cannot be improved upon, but I'm sure someone will
  24. '        find a way to make it better.  If it's you, I'm looking forward to
  25. '        seeing your changes.  I can be reached at:
  26. '
  27. '              Tim Beck                      Tim Beck (C/O Debbie Beck)
  28. '              19419 Franz Road              8030 Fairchild Avenue
  29. '              Houston, Texas  77084         Canoga Park, California 91306
  30. '              (713) 639-3079                (818) 998-0588
  31. '
  32. '     3. This code has been tested and re-tested in a variety of applications
  33. '        and although I have not found any bugs, doesn't mean none exist. So,
  34. '        this program along with it's companions comes with NO WARRANTY,
  35. '        either expressed or implied.  I'm sorry if there are problems, but
  36. '        I can't be responsible for your work.  I've tried to provide a safe
  37. '        and efficient programming enviroment and I hope you find it helpful
  38. '        for you.  I do, however, need to cover my butt!
  39. '
  40. '  I have enjoyed creating this library of programs and have found them to be
  41. '  a great time saver.  I hope you agree.
  42. '
  43. '                                                            Tim Beck //
  44. '
  45. '****************************************************************************
  46.  
  47.     DECLARE SUB CLOSE.WINDOW (wid%)
  48.     DECLARE SUB MAKEMONO (attr%)
  49.     DECLARE SUB QWINIT (ver%)
  50.     DECLARE SUB VIDMODE (mode%)
  51.     DECLARE SUB VIDTYPE (card%, mono%, rows%, cols%, mode%)
  52.   
  53.     DECLARE SUB SYSINIT (ver%, mono%)
  54.  
  55.     '-------------------------------------------------------------------------
  56.     'Initialize STDLIB/QWADV Routines
  57.     '
  58.     '  ver% = Current Version of Basic in use:
  59.     '         3 = QuickBasic 2.X, 3.X or BASIC 5.36
  60.     '         4 = QuickBasic 4.X, BASIC 6.X or IBM BASIC 2.X
  61.     '         5 = QBX or BASIC 7.X
  62.     '  mono%= MonoChrome Flag:
  63.     '         0 = Color
  64.     '         1 = MonoChrome
  65.  
  66.     REM $INCLUDE: 'STDCOM.INC'
  67.  
  68.     TIMER OFF 'Enables event trapping
  69.  
  70. SUB SYSINIT (ver%, mode%) STATIC
  71.  
  72.   'KeyStrokes
  73.     Escape% = 27
  74.     Enter% = 13
  75.  
  76.     Left.Arrow% = 19200
  77.     Right.Arrow% = 19712
  78.     Up.Arrow% = 18432
  79.     Down.Arrow% = 20480
  80.     Page.Up% = 18688
  81.     Page.Down% = 20736
  82.  
  83.     Insert% = 20992
  84.     Delete% = 21248
  85.     Home% = 18176
  86.     End.Key% = 20224
  87.  
  88.     Back.Space% = 8
  89.     Horiz.Tab% = 9
  90.     Back.Tab% = 3840
  91.  
  92.     F.1% = 15104
  93.     F.2% = 15360
  94.     F.3% = 15616
  95.     F.4% = 15872
  96.     F.5% = 16128
  97.     F.6% = 16384
  98.     F.7% = 16640
  99.     F.8% = 16896
  100.     F.9% = 17152
  101.     F.10% = 17408
  102.   
  103.     Ctrl.Home% = 30464
  104.     Ctrl.End% = 29952
  105.     Ctrl.Pgup% = -31744
  106.     Ctrl.PgDn% = 30208
  107.     Ctrl.Right% = 29696
  108.     Ctrl.Left% = 29440
  109.   
  110.     Ctrl.A% = 1
  111.     Ctrl.B% = 2
  112.     Ctrl.C% = 3
  113.     Ctrl.D% = 4
  114.     Ctrl.E% = 5
  115.     Ctrl.F% = 6
  116.     Ctrl.G% = 7
  117.     Ctrl.H% = 8
  118.     Ctrl.I% = 9
  119.     Ctrl.J% = 10
  120.     Ctrl.K% = 11
  121.     Ctrl.L% = 12
  122.     Ctrl.M% = 13
  123.     Ctrl.N% = 14
  124.     Ctrl.O% = 15
  125.     Ctrl.P% = 16
  126.     Ctrl.Q% = 17
  127.     Ctrl.R% = 18
  128.     Ctrl.S% = 19
  129.     Ctrl.T% = 20
  130.     Ctrl.U% = 21
  131.     Ctrl.V% = 22
  132.     Ctrl.W% = 23
  133.     Ctrl.X% = 24
  134.     Ctrl.Y% = 25
  135.     Ctrl.Z% = 26
  136.   
  137.     Ctrl.F.1% = 24064
  138.     Ctrl.F.2% = 24320
  139.     Ctrl.F.3% = 24576
  140.     Ctrl.F.4% = 24832
  141.     Ctrl.F.5% = 25088
  142.     Ctrl.F.6% = 25344
  143.     Ctrl.F.7% = 25600
  144.     Ctrl.F.8% = 25856
  145.     Ctrl.F.9% = 26112
  146.     Ctrl.F.10% = 26368
  147.  
  148.     Alt.A% = 7680
  149.     Alt.B% = 12288
  150.     Alt.C% = 11776
  151.     Alt.D% = 8192
  152.     Alt.E% = 4608
  153.     Alt.F% = 8448
  154.     Alt.G% = 8704
  155.     Alt.H% = 8960
  156.     Alt.I% = 5888
  157.     Alt.J% = 9216
  158.     Alt.K% = 9472
  159.     Alt.L% = 9728
  160.     Alt.M% = 12800
  161.     Alt.N% = 12544
  162.     Alt.O% = 6144
  163.     Alt.P% = 6400
  164.     Alt.Q% = 4096
  165.     Alt.R% = 4864
  166.     Alt.S% = 7936
  167.     Alt.T% = 5120
  168.     Alt.U% = 5632
  169.     Alt.V% = 12032
  170.     Alt.W% = 4352
  171.     Alt.X% = 11520
  172.     Alt.Y% = 5376
  173.     Alt.Z% = 11264
  174.   
  175.     Alt.F.1% = 26624
  176.     Alt.F.2% = 26880
  177.     Alt.F.3% = 27136
  178.     Alt.F.4% = 27392
  179.     Alt.F.5% = 27648
  180.     Alt.F.6% = 27904
  181.     Alt.F.7% = 28160
  182.     Alt.F.8% = 28416
  183.     Alt.F.9% = 28672
  184.     Alt.F.10% = 28928
  185.  
  186.     Shift.Tab% = 3840
  187.   
  188.     Shift.F.1% = 21504
  189.     Shift.F.2% = 21760
  190.     Shift.F.3% = 22016
  191.     Shift.F.4% = 22272
  192.     Shift.F.5% = 22528
  193.     Shift.F.6% = 22784
  194.     Shift.F.7% = 23040
  195.     Shift.F.8% = 23296
  196.     Shift.F.9% = 23552
  197.     Shift.F.10% = 23808
  198.  
  199.     Key.Flag% = -1            'Returns Unused key values (F1, F2, etc)
  200.   
  201.   'Status Line Information
  202.     Display.Cap.Lock% = -1    'Cap.Lock Display is on
  203.     Display.Num.Lock% = -1    'Num.Lock Display is on
  204.     Display.Insert.Key% = -1  'Insert Key Display is on
  205.     Status.Line.Row% = 24     'Status Line Row = 24
  206.     Status.Line.Col% = 60     'Status Line Col = 60
  207.  
  208.     CALL QWINIT(ver%)                                  'Initialize QW
  209.     CALL CLOSE.WINDOW(0)                               'Initialize Windows
  210.     CALL VIDTYPE(card%, mono%, cols%, rows%, mode%)    'Determine Color or Mono
  211.     IF card% = 0 OR mono% = 0 OR card% = 1 OR mono% = 1 OR card% = 4 OR mono% = 4 THEN
  212.       'Colors - 15 is Brightwhite, 7 is White, 0 is black, 1 is blue
  213.         S.Fore% = 15      'Screen Foreground
  214.         S.Back% = 0       'Screen Background
  215.         M.Fore% = 7       'Menu Foreground
  216.         M.Back% = 0       'Menu Background
  217.         H.Fore% = 0       'Help Foreground
  218.         H.Back% = 7       'Help Background
  219.         DE.Fore% = 0      'Data Entry Foreground
  220.         DE.Back% = 7      'Data Entry Background
  221.         HB.Fore% = 0      'Highlight Bar Foreground
  222.         HB.Back% = 7      'Highlight Bar Background
  223.         MB.Fore% = 0      'Menu Bar Foreground
  224.         MB.Back% = 7      'Menu Bar Background
  225.  
  226.       'Attributes are calculated as follows:
  227.       '  Foreground + (Background * 16)
  228.         S.attr% = 15
  229.         M.attr% = 7
  230.         H.attr% = 112
  231.         DE.attr% = 112
  232.         HB.attr% = 112
  233.         MB.attr% = 112
  234.  
  235.         Sh.Flag% = 16           'Transparent Shadow (0=no Shadow, 16=Solid Shadow)
  236.         EX.Flag% = 0            'Exploding Windows off (128=On)
  237.  
  238.         CALL MAKEMONO(1)
  239.         IF (card% = 1) THEN
  240.             IF NOT (mode% = 7) THEN
  241.                 CALL VIDMODE(7)
  242.             END IF
  243.         ELSE
  244.             IF NOT (mode% = 2) THEN
  245.                 CALL VIDMODE(2)
  246.             END IF
  247.         END IF
  248.         mode% = 1               'MonoChrome
  249.     ELSE
  250.       'Colors - 15 is Brightwhite, 7 is White, 0 is black, 1 is blue, 4 is Red
  251.         S.Fore% = 15      'Screen Foreground
  252.         S.Back% = 1       'Screen Background
  253.         M.Fore% = 1       'Menu Foreground
  254.         M.Back% = 7       'Menu Background
  255.         H.Fore% = 1       'Help Foreground
  256.         H.Back% = 7       'Help Background
  257.         DE.Fore% = 1      'Data Entry Foreground
  258.         DE.Back% = 7      'Data Entry Background
  259.         HB.Fore% = 1      'Highlight Bar Foreground
  260.         HB.Back% = 7      'Highlight Bar Background
  261.         MB.Fore% = 1      'Menu Bar Foreground
  262.         MB.Back% = 7      'Menu Bar Background
  263.  
  264.       'Attributes are calculated as follows:
  265.       '  Foreground + (Background * 16)
  266.         S.attr% = 31
  267.         M.attr% = 23
  268.         H.attr% = 113
  269.         DE.attr% = 113
  270.         HB.attr% = 113
  271.         MB.attr% = 113
  272.  
  273.         Sh.Flag% = 48           'Transparent Shadow (0=no Shadow, 16=Solid Shadow)
  274.         EX.Flag% = 0            'Exploding Windows off (128=On)
  275.  
  276.         IF NOT (mode% = 3) THEN
  277.             CALL VIDMODE(3)
  278.         END IF
  279.         mode% = 0               'Color
  280.     END IF
  281.  
  282.     SCREEN 0
  283.  
  284. END SUB
  285.  
  286.