home *** CD-ROM | disk | FTP | other *** search
/ Prima Shareware 3 / DuCom_Prima-Shareware-3_cd1.bin / PROGRAMO / PASCAL / PMAGIC / MAGIC.DOC < prev    next >
Encoding:
Text File  |  1992-11-16  |  139.0 KB  |  3,573 lines

  1.  
  2.  
  3.                            PASCAL MAGIC Version 3.01
  4.  
  5.                                   Magic Unit
  6.  
  7.                                 Reference File
  8.  
  9.  
  10.                 An Add-in For Borland Turbo Pascal, Version 7.0
  11.  
  12.                  Copyright 1991, Jeff Napier & Another Company
  13.  
  14.  
  15.          What Magic will do for you:
  16.  
  17.          *   Make  professional  multi-color,  shadowed  pop-up  help,
  18.          warnings, dialog,  general  text  boxes  and  lightbar  menus
  19.          instantly without wasting your time 're-inventing the wheel'.
  20.  
  21.          * Incorporate .BGI graphics drivers and .CHR fonts into  your
  22.          .EXE programs by typing a single word!
  23.  
  24.          * Gain mouse support without  writing  a  mouse  driver.  The
  25.          mouse  procedures  provide a graphics cursor whether or not a
  26.          mouse is installed and it can  be  driven  from  keyboard  or
  27.          mouse.
  28.  
  29.          *  Display  most  .PCX files from within your programs with a
  30.          single line of code.
  31.  
  32.          * Built-in 256-color VGA and Super-VGA driver.
  33.  
  34.          * Gain color control without writing color control code.
  35.  
  36.          * Many Turbo Pascal procedures greatly simplified.
  37.  
  38.          * Write graphics-based programs as easily as text-based.
  39.  
  40.          * Disk file handling is done automatically.
  41.  
  42.          * Enlarged cursor available for your programs  for  use  with
  43.            laptop LCD displays.
  44.  
  45.          * Add sound effects to your program effortlessly.
  46.  
  47.          *  Source  code  is  available so you can study and customize
  48.          Magic procedures to your needs.
  49.  
  50.          *  Pascal  Magic  coexists   peacefully   with   most   other
  51.          programming libraries.
  52.  
  53.          Notice: This is shareware. Feel free to copy  and  distribute
  54.          without  modification.   If  you use any portion of the Magic
  55.          Unit in your programs then registration is a legal necessity.
  56.          Send $39.95 to Another  Company.   Complete,  well-documented
  57.          easy-to-understand source code is available. For registration
  58.          + source code, send $79.90.
  59.  
  60.          Send US funds drawn on a US bank to:
  61.  
  62.                                 Another Company
  63.                                  P.O. Box 298
  64.                               Applegate, OR 97530
  65.                                       USA
  66.                                  503-846-7884
  67.  
  68.          Please add $3 US postage ($5-Canada; &7-Overseas) per order.
  69.  
  70.          Please add $1 if you need 3.5" disk size.
  71.  
  72.          Even  though  this seems quite bug-free to me, you may find a
  73.          surprise or two. I make no  warranty.  Please  feel  free  to
  74.          submit bug reports, and I will try to incorporate appropriate
  75.          fixes.
  76.  
  77.          (If  you  are  new  to  Pascal,  or  if  you  would  like   a
  78.          step-by-step guide, you are looking at the wrong file. Please
  79.          see Tutorial.txt first.)
  80.  
  81.          If you want to become familiar with  the  look  and  feel  of
  82.          Pascal  Magic,  you  might  want  to  skim  the tutorial file
  83.          starting at program #6 (prog6).
  84.  
  85.          Note:  Fonts2.tpu,  Fonts.tpu,   Video.tpu,   and   Borland's
  86.          Graph.tpu must be in the same sub-directory in which you keep
  87.          your .tpu files.
  88.  
  89.          Note:  Pascal  Magic  version  3.0 is not backward compatible
  90.          with versions 2.0 or 1.0.
  91.  
  92.          Note: Pop-up text box routines do  not  have  built-in  error
  93.          checking for size, screen position or memory usage.
  94.  
  95.          Note:  Borland  Pascal  with  Objects contains three compiler
  96.          versions to run under DOS real mode, DOS protected  mode  and
  97.          Windows.  Pascal Magic is for DOS  real mode  programs  only,
  98.          and  will  not  run  properly  under  the  protected mode and
  99.          Windows compilers.  It will run, but there is a  small  "bug"
  100.          in  the  way  the other compilers juggle the interrupt vector
  101.          table, even if compiling in real mode.  The result  of  using
  102.          any  compiler  other  than  TURBO.EXE  with MAGIC.TPU is that
  103.          computers  without  a  mouse  will  exhibit  erratic   cursor
  104.          behavior.
  105.  
  106.          NOTE:  Because  of  the  heap  requiremets  of  the  IDE plus
  107.          MAGIC.TPU, you must compile to disk.  To set this adjustment,
  108.          select COMPILE from the top menu,  then  select  "COMPILE  TO
  109.          DISK."
  110.  
  111.  
  112.                        ALPHABETICALLY ARRANGED REFERENCE
  113.                   TO ALL THE FEATURES AVAILABLE IN MAGIC UNIT
  114.  
  115.          NOTE:  All  procedures,  functions  and global variables work
  116.          identically in text and all graphics modes  unless  otherwise
  117.          stated.
  118.          *************************************************************
  119.          Answer - Global Variable, string[80]
  120.  
  121.          Description:
  122.             Answer  is  a  string  which  is returned by the procedure
  123.          Dialog. You can also use Answer as a general  purpose  global
  124.          string variable.
  125.  
  126.          Considerations:
  127.             Maximum size of Answer is 80 characters.
  128.  
  129.          See also: Dialog
  130.  
  131.          Example:
  132.          program test;
  133.          uses magic;
  134.          begin
  135.             Sent[1] := 'Write your answer here';
  136.             Present.Dialog(1,1);
  137.             if copy(Answer,1,2) = 'I ' then User_Started_With_I;
  138.             .
  139.             .
  140.          end.
  141.          *************************************************************
  142.          BarBack - Global Variable, byte
  143.  
  144.          Description:
  145.          This sets the background color for  lightbar  backgrounds  in
  146.          menus,  where 'color' is an integer from 0 to 7, in text mode
  147.          or 0 to 15 in most graphics modes, or  a  color  constant  as
  148.          defined  by  Borland.  The  colors 0 - 7 are the same in both
  149.          text and graphics modes.
  150.  
  151.          Considerations:
  152.          May not have the expected effect when used with  the  limited
  153.          palettes  of  4-color  CGA  (mode  0,1  or 2), 2-color CGA or
  154.          Hercules.  In text mode, because backgrounds are limited to 8
  155.          colors, only the values 0 - 7 works as expected.
  156.  
  157.          See also: BarText, BoxBack, BoxText
  158.  
  159.          Example:
  160.          program test;
  161.          uses magic;
  162.          begin
  163.             Sent[1] := 'First Thing';
  164.             Sent[2] := 'Second Thing';
  165.             Sent[3] := 'Quit';
  166.             Mc := 1;
  167.             BarBack := Red;
  168.             Present.Menu(-1,-1);
  169.             .
  170.             .
  171.          end.
  172.          *************************************************************
  173.          BarText - Global Variable, byte
  174.  
  175.          Description:
  176.          This sets the color for lightbar text in menus, where 'color'
  177.          is an integer from 0 to 15 or a color constant as defined  by
  178.          Borland. Colors are the same in graphics and text modes.
  179.  
  180.          Considerations:
  181.          May  not  have the expected effect when used with the limited
  182.          palettes of 4-color CGA (mode  0,1  or  2),  2-color  CGA  or
  183.          Hercules.
  184.  
  185.          See also: BarBack, BoxBack, BoxText
  186.  
  187.          Example:
  188.          program test;
  189.          uses magic;
  190.          begin
  191.             Sent[1] := 'First Thing';
  192.             Sent[2] := 'Second Thing';
  193.             Sent[3] := 'Quit';
  194.             Mc := 1;
  195.             BarText := red;
  196.             Present.Menu(-1,-1);
  197.             .
  198.             .
  199.          end.
  200.          *************************************************************
  201.          BestVideo - Procedure
  202.  
  203.          Description:
  204.          By  simply  declaring  BESTVIDEO,  the  program  detects  the
  205.          graphics card present and switches to the best graphics  mode
  206.          possible  for  that  card.  When  the program is compiled all
  207.          video drivers (*.BGI files) are automatically built into  the
  208.          .EXE  file.  The  compiled  program will therefore run on any
  209.          standard graphics-equipped system, but will be large in size.
  210.  
  211.          Considerations:
  212.          Bestvideo  does  not  auto-detect  Super-VGA  equipment,  and
  213.          provides VGA-Hi 640 x 480 16-color on Super-VGA systems.
  214.  
  215.          See also:
  216.          CGAHiVideo,  CGALoVideo,  EgaHiVideo,  EGALoVideo, HercVideo,
  217.          VgaHiVideo,   VGALoVideo,   SVGAVideo,   all   Borland  Graph
  218.          procedures & functions.
  219.  
  220.          Example:
  221.          program test;
  222.          uses crt,graph,magic;
  223.          begin
  224.             BestVideo;
  225.             line(0,0,getmaxx,getmaxy);
  226.             repeat until keypressed;
  227.             CleanUp;
  228.          end.
  229.  
  230.          Performance of example:
  231.          Initializes best graphics mode, draws a  diagonal  line  from
  232.          the  upper  left  corner  to  the  lower  right corner of the
  233.          screen,  waits  until  a  key  is  pressed,  then  terminates
  234.          gracefully.  Crt  must be in the uses line because keypressed
  235.          is a procedure within the Crt unit (Turbo.tpl).
  236.          *************************************************************
  237.          BigCursor - Procedure
  238.  
  239.          Description:
  240.          After  a call to BigCursor, the cursor in text mode will be a
  241.          block the size of a whole character instead of an  underline.
  242.          This  is  particularly  useful  in  programs designed for LCD
  243.          laptop  screens.   Unless  a  specific  call   is   made   to
  244.          SmallCursor  before  the  end  of the program, the big cursor
  245.          will remain in effect at the DOS prompt and within most other
  246.          programs.
  247.  
  248.          Considerations:
  249.             Has  no  effect  in  graphics  modes, but will resume as a
  250.          large cursor when returned to text mode.
  251.  
  252.          Example:
  253.          program test;
  254.          uses magic;
  255.          begin
  256.             BigCursor;
  257.             write('Big cursor at the end of this line!');
  258.          end.
  259.  
  260.          Performance of Example:
  261.          This program will write 'Big cursor at the end of this line',
  262.          then quit. If run from the IDE, nothing will seem to  happen,
  263.          but if compiled and run from DOS, after execution, the cursor
  264.          will become large and stay that way.
  265.  
  266.          *************************************************************
  267.          Bird - Procedure
  268.  
  269.          Description:
  270.             A sound effect.
  271.  
  272.          Considerations:
  273.             Calls  to  Bird are ignored if MusicOn (global boolean) is
  274.          false.
  275.  
  276.          example:
  277.          program test;
  278.          uses magic;
  279.          begin
  280.             .
  281.             .
  282.             MusicOn := true;
  283.             Bird;
  284.          end.
  285.          *************************************************************
  286.          BitMap - Procedure
  287.  
  288.          Description:
  289.              Causes OutText, and OutTextXY to use the "DefaultFont" or
  290.          the built in (into GRAPH.TPU) 8 x 8 bitmapped font.
  291.  
  292.          Considerations:
  293.              Use  this  after  calls  to  Triplex,  Script,   etc   or
  294.          SetTextStyle, to return to 8 x 8 bitmapped font.
  295.  
  296.          See Also:
  297.          Triplex, BitMap, Little, Sansserif, Gothic,  Script,  Italic,
  298.          European  {Magic}  Settextstyle, DefaultFont, SetUserCharSize
  299.          {Borland}
  300.  
  301.          Example:
  302.          program test;
  303.          uses graph, magic;
  304.          begin
  305.             vgahivideo;
  306.             triplex;
  307.             OutTextXY(0,10,'This is Triplex font');
  308.             BitMap;
  309.             OutTextXY(0,40,'This is the Bitmap font');
  310.             settextstyle(0,0,4);
  311.             OutTextXY(0,100,'This is large Bitmap');
  312.             BitMap;
  313.             OutTextXY(0,200,'Back to normal');
  314.             WaitForUser;
  315.             CleanUp;
  316.          end.
  317.          *************************************************************
  318.          Bold - Procedure
  319.  
  320.          Description:
  321.              Calling  the  procedure  Bold makes the Borland Bold font
  322.          available  to  graphic-based  programs.  This  font  will  be
  323.          compiled  into  the  .EXE  file.   Bold.CHR  does not have to
  324.          accompany the finished product.
  325.  
  326.          Considerations:
  327.          Compiled .EXE size increases by about 17k. Dimensions of  the
  328.          Bold    font   can   be   changed   with   SetTextStyle   and
  329.          SetUserCharSize.   Bold   is   font   #10   (for   use   with
  330.          SetTextStyle).
  331.  
  332.          See Also:
  333.          SansSerif, BitMap, Triplex, Little, Italic, Script, European,
  334.          Gothic,  Simple,  Lcom  {Magic} SetUserCharSize, SetTextStyle
  335.          {Borland}
  336.  
  337.          Example:
  338.          Program Test;
  339.          uses crt, graph, magic;
  340.          begin
  341.             BestVideo;
  342.             Bold;
  343.             OutTextXY(0,0,'Regular-size Bold');
  344.             SetTextStyle(10,0,9);
  345.             OutTextXY(100,100,'Huge');
  346.             WaitForUser;
  347.          end.
  348.          *************************************************************
  349.          Border - Global Variable
  350.  
  351.          Description:
  352.          Color  is represented with an integer  from  0  to  15  or  a
  353.          pre-defined  color  constant (Borland). Changing the value of
  354.          Border will affect the color of borders drawn  around  pop-up
  355.          text  boxes,  dialog  boxes  and  menus.  Colors are the same
  356.          in text and graphics mode.
  357.  
  358.          Considerations:
  359.          May  not  have the expected effect when used with the limited
  360.          palettes of 4-color CGA (mode  0,1  or  2),  2-color  CGA  or
  361.          Hercules.
  362.  
  363.          See Also:
  364.          Shadow,  MainBack,  MainText,  BoxBack,   BoxText,   Barback,
  365.          Bartext.
  366.  
  367.          Example:
  368.          Program Test;
  369.          uses magic;
  370.          begin
  371.             Border := white;
  372.             Sent[1] := 'Do you like this border color?';
  373.             Present.GetAnyKey(-1,-1);
  374.          end.
  375.  
  376.          Performance of example:
  377.          The  border  color  is set to white. A box will appear on the
  378.          screen asking a silly question. The box  will  have  a  white
  379.          border. When a key is pressed, the program quits.
  380.  
  381.          *************************************************************
  382.          BoxBack - Global Variable
  383.  
  384.          Description:
  385.          Color  is represented with an integer  from  0  to  15  or  a
  386.          pre-defined  color  constant (Borland). Changing the value of
  387.          BoxBack  will  affect  the  background color of pop-up boxes,
  388.          text boxes, dialog boxes and menus.
  389.  
  390.          Considerations:
  391.             Do not use background colors above 7 in text mode. May not
  392.          have the expected effect when used with the limited  palettes
  393.          of 4-color CGA (mode 0,1 or 2), 2-color CGA or Hercules.
  394.  
  395.          See Also:
  396.          MainBack, MainText, BoxText, Barback, Bartext.
  397.  
  398.          Example:
  399.          Program Test;
  400.          uses magic;
  401.          begin
  402.             BoxBack := magenta;
  403.             Sent[1] := 'Do you like this background color?';
  404.             Present.GetAnyKey(-1,-1);
  405.          end.
  406.  
  407.          Performance of example:
  408.          The  box  background  color  is  set  to  magenta. A box will
  409.          appear on the screen asking a silly question.  The  box  will
  410.          have  a  magenta  background.   When  a  key  is pressed, the
  411.          program quits.
  412.          *************************************************************
  413.          Boxo - Object
  414.  
  415.          Description
  416.             Boxo  is  the object level responsible for calculating and
  417.          management of the pop-up boxes in text  and  graphics  modes.
  418.          Usually,  it's  methods  are  called  by  instances  of  it's
  419.          descendant, Presento (which see).
  420.  
  421.             Boxo contains these methods:
  422.                constructor Init(x,y : integer);
  423.                procedure textmake(x,y : integer); virtual;
  424.                procedure make(x,y : integer); virtual;
  425.                destructor Done; virtual;
  426.  
  427.          For more information, look up these methods by name.
  428.          *************************************************************
  429.          BoxText - Global Variable
  430.  
  431.          Description:
  432.          Color  is represented with an integer  from  0  to  15  or  a
  433.          pre-defined color constant (Borland). Changing the  value  of
  434.          BoxText  will  affect  the  text  color in pop-up boxes, text
  435.          boxes,  dialog  boxes and menus.  Colors are the same in text
  436.          and graphics modes.
  437.  
  438.          Considerations:
  439.          May  not  have the expected effect when used with the limited
  440.          palettes of 4-color CGA (mode  0,1  or  2),  2-color  CGA  or
  441.          Hercules.
  442.  
  443.          See Also:
  444.          MainBack, MainText, BoxText, Barback, Bartext.
  445.  
  446.          Example:
  447.          Program Test;
  448.          uses magic;
  449.          begin
  450.             BoxText := black;
  451.             Sent[1] := 'Do you like this text color?';
  452.             Present.GetAnyKey(-1,-1);
  453.          end.
  454.  
  455.          Performance of example:
  456.          The  box text color is set to black. A box will appear on the
  457.          screen asking a silly question.  The box will  contain  black
  458.          text.
  459.          *************************************************************
  460.          Bugle - Procedure
  461.  
  462.          Description:
  463.             A sound effect.
  464.  
  465.          Considerations:
  466.             Calls to Bugle are ignored if MusicOn (global boolean)  is
  467.          false.
  468.  
  469.          example:
  470.          program test;
  471.          uses magic;
  472.          begin
  473.             .
  474.             .
  475.             MusicOn := true;
  476.             Bugle;
  477.          end.
  478.          *************************************************************
  479.          Center - Global Variable, boolean
  480.  
  481.          Description:
  482.              Center is used to track status of the center mouse button
  483.          with  three-button  mice.   When  true, the center button has
  484.          been pressed as of the last call to Poll.
  485.  
  486.          Considerations:
  487.              With two-button mice, or  when  no  mouse  is  installed,
  488.          Center is always false.
  489.  
  490.          example:
  491.          program test:
  492.          uses magic;
  493.          begin
  494.             .
  495.             .
  496.             Poll;
  497.             if Center then Help_Procedure;
  498.             .
  499.             .
  500.          end.
  501.  
  502.          *************************************************************
  503.          CenterJustify - Global Variable
  504.  
  505.          Description:
  506.          If you set the  boolean  global  CenterJustify  to  true  all
  507.          subsequent  calls  to Present.Init, Dialog, GetYN, GetAnyKey,
  508.          and Menu will contain centered text.
  509.  
  510.          Considerations:
  511.             When a program starts,  CenterJustify  is  false.  If  you
  512.          change  CenterJustify  to true all subsequent uses of it will
  513.          remain true until you specifically change it back  to  false.
  514.          Works the same in graphics and text modes.
  515.  
  516.          See Also:
  517.          Present.Init, GetAnyKey, GetYN, Dialog, Menu.
  518.  
  519.          Example:
  520.          Program Test;
  521.          uses magic;
  522.          begin
  523.             CenterJustify := true;
  524.             Sent[1] := 'This is a very long line of text to display';
  525.             Sent[2] := 'This is short';
  526.             Present.GetAnyKey(-1,-1);
  527.          end.
  528.  
  529.          Performance of example:
  530.          Two  lines of text will pop up on the screen and wait until a
  531.          user presses any key. The second line will be centered  under
  532.          the first.
  533.          *************************************************************
  534.          CGAHiVideo - Procedure
  535.  
  536.          Description:
  537.          This  sets  the  system  in  CGA  high-resolution (640 x 200,
  538.          2-color)  graphics  mode.    CGA   video   driver   will   be
  539.          automatically   compiled   into   the   .EXE   program  file,
  540.          eliminating the need for external CGA.BGI file.
  541.  
  542.          Considerations:
  543.          Will not work on Hercules-equipped  computers.  Graphmode  is
  544.          initially set to 4 (see Borland manual for more details).  In
  545.          this  mode,  with  default  colors,  some  LCD laptops may be
  546.          unreadable. The resulting .EXE file is much smaller than  one
  547.          compiled  after  a  call  to  BestVideo.  Video.Tpu  must  be
  548.          available until after compilation.
  549.  
  550.          See Also:
  551.          CGALoVideo,  BestVideo,  HercVideo,  EGALoVideo,  EGAHiVideo,
  552.          Vgahivideo, VGALoVideo, SVGAVideo
  553.  
  554.          Example:
  555.          Program Test;
  556.          uses crt,graph, magic;
  557.          begin
  558.             CGAHiVideo;
  559.             rectangle(10,10,629,189);
  560.             repeat until keypressed;
  561.             CleanUp;
  562.          end.
  563.  
  564.          Performance of example:
  565.          The system is put in CGA-Hi graphics mode. A large  rectangle
  566.          is  displayed  until  any  key  is pressed.  The program then
  567.          terminates gracefully. The colors used for this  example  may
  568.          not be easily distinguished on a laptop LCD display. Crt must
  569.          be  in the Uses line because keypressed is a procedure within
  570.          the Crt unit (Turbo.tpl).
  571.          *************************************************************
  572.          CGALoVideo - Procedure
  573.  
  574.          Description:
  575.          This sets the  system  in  CGA  low-resolution  (320  x  200,
  576.          4-color)   graphics   mode.    CGA   video   driver  will  be
  577.          automatically  compiled   into   the   .EXE   program   file,
  578.          eliminating the need for external CGA.BGI file.
  579.  
  580.          Considerations:
  581.          Will not work on Hercules-equipped  computers.  Graphmode  is
  582.          initially set to 0 (see Borland manual for more details).  In
  583.          this  mode,  with  default  colors,  some  LCD laptops may be
  584.          unreadable. The resulting .EXE file is much smaller than  one
  585.          compiled  after  a  call  to  BestVideo.  Video.Tpu  must  be
  586.          available until after compilation.
  587.  
  588.          See Also:
  589.          CGAHiVideo,  BestVideo,  HercVideo,  EGALoVideo,  EGAHiVideo,
  590.          Vgahivideo, VGALoVideo, SVGAVideo
  591.  
  592.          Example:
  593.          Program Test;
  594.          uses crt,graph, magic;
  595.          begin
  596.             CGALoVideo;
  597.             rectangle(10,10,309,189);
  598.             repeat until keypressed;
  599.             CleanUp;
  600.          end.
  601.  
  602.          Performance of example:
  603.          The system is put in CGA-Lo graphics mode. A large  rectangle
  604.          is  displayed  until  any  key  is pressed.  The program then
  605.          terminates gracefully. The colors used for this  example  may
  606.          not be easily distinguished on a laptop LCD display. Crt must
  607.          be  in the Uses line because keypressed is a procedure within
  608.          the Crt unit (Turbo.tpl).
  609.          *************************************************************
  610.          CleanUp - Procedure
  611.  
  612.          Description:
  613.          This  procedure  clears  the  screen,  and  performs  closing
  614.          functions, resulting in a graceful return to DOS.
  615.  
  616.          Considerations:
  617.          Call CleanUp as the last line executed in a program. Works in
  618.          graphics and text modes.
  619.  
  620.          Example:
  621.          Program Test;
  622.          uses crt, graph, magic;
  623.          begin
  624.             CGALoVideo;
  625.             rectangle(10,10,309,189);
  626.             repeat until keypressed;
  627.             CleanUp;
  628.          end.
  629.  
  630.          Performance of example:
  631.          The  system is put in CGA graphics mode. A large rectangle is
  632.          displayed   until  any  key  is  pressed.  The  program  then
  633.          terminates  gracefully  to the DOS prompt. Crt must be in the
  634.          Uses statement because keypressed is a procedure  within  the
  635.          Crt unit (Turbo.tpl).
  636.          *************************************************************
  637.          ClearSents - Procedure
  638.  
  639.          Description:
  640.          This procedure resets the strings in the global array  Sent[]
  641.          to  blanks.   It  also  resets  the global byte HowMany to 0,
  642.          indicating no strings in the array contain text.
  643.  
  644.          Considerations:
  645.          ClearSents  is  called  automatically  upon   completion   by
  646.          Presento.Menu,     Presento.Dialog,     Presento.GetYN    and
  647.          Presento.GetAnyKey.  However,  Presento.Init  does  not  call
  648.          ClearSents.   Use  of  the  procedure Pile should not be done
  649.          until you have called ClearSents or when the value of HowMany
  650.          is known.
  651.  
  652.          Example:
  653.          program test;
  654.          uses magic;
  655.          begin
  656.             Pile('This is a line of text');
  657.             Pile('This is another line');
  658.             Present.Init;
  659.             ClearSents;
  660.             Pile('This is Sent[1], starting over');
  661.             .
  662.             .
  663.          end.
  664.          *************************************************************
  665.          Dialog - Object Method
  666.  
  667.          Description:
  668.              Dialog is a method introduced  in  the  Presento  object.
  669.          The  Magic  Unit  provides a predeclared instance of Presento
  670.          called Present.  Typical use of Dialog is as follows:
  671.  
  672.          Present.Dialog(x,y);
  673.  
  674.              Dialog  requires  two  integers,  an x (horizontal) and y
  675.          (vertical) to establish the position of the upper left corner
  676.          of the dialog box on the screen.  In  text  mode,  the  upper
  677.          left corner is 1,1, and the lower right is 80,25. In graphics
  678.          mode  the upper left is 0,0, and the lower right is variable,
  679.          depending on the current graphics card and mode.
  680.              You  can  force  Dialog  to  pop-up  in the center of the
  681.          screen by using  a  negative  number  for  the  x  and the  y
  682.          positions.
  683.              Dialog will pop up a box on the screen  containing  lines
  684.          of  text  and  one  blank line at the bottom of the box.  The
  685.          user is prompted to type an Answer in that bottom  line.  The
  686.          lines  that  will  be displayed are predeclared as the array:
  687.          Sent[1..48].
  688.              To  use  Dialog,  you  must  first assign the text to the
  689.          array. Use as many lines as you like up  to  19,  as  in  the
  690.          example  below.  Dialog   will   automatically  ignore  lines
  691.          beyond those which contain your text. When the  user  presses
  692.          [Enter]  or  clicks  the  left  mouse  button, the dialog box
  693.          disappears. A new string exists called Answer, which contains
  694.          what the user typed. The Sent[1..19] array is cleared.
  695.              The user can type an answer string as long as the longest
  696.          Sent[]  in the dialog box. To get a longer answer string, pad
  697.          any Sent[] string with spaces to make the dialog box wider.
  698.              Dialog works in text or graphics mode.
  699.  
  700.          DIALOG IS NOT A  FUNCTION.   When  it  is  done,  the  user's
  701.          response is in a global variable string called Answer.
  702.  
  703.          Considerations:
  704.              See  above. Dialog calls it's own destructor  when  done,
  705.          removing all traces of itself from RAM.
  706.  
  707.          See  also: Sent[], Present, Init, GetYN, GetAnyKey,
  708.          Menu
  709.  
  710.          Example:
  711.          Program Test;
  712.          uses magic;
  713.          var teststring : string;
  714.          begin
  715.             Sent[1] := '    How would you answer this question?   ';
  716.             Sent[2] := '            Any answer will do.';
  717.             Present.Dialog(-1,5);
  718.             teststring := Answer;
  719.             .
  720.             .
  721.          end.
  722.  
  723.          Performance of example:
  724.          Only the first two strings from the array Sent[]  are  filled
  725.          with  text.  Dialog  is called and pops a box onto the screen
  726.          containing only those two Sent[]s, plus an empty line at  the
  727.          bottom.   The  program  then  waits  for  the user to type an
  728.          answer in the empty line then press [Enter] or click the left
  729.          mouse button. The dialog box  is  wider  than  the  questions
  730.          because  they  have  been padded with spaces. This allows the
  731.          user room for a long answer. Since the first  number  in  the
  732.          variables passed to Dialog is  a  -1,  the  box  is  centered
  733.          horizontally  on  the screen. After the user finishes typing,
  734.          the dialog box disappears, leaving a  string  called  Answer.
  735.          The  TestString is a copy of Answer and the program can go on
  736.          to process it as desired.
  737.  
  738.          *************************************************************
  739.          Done - Object Destructor
  740.  
  741.          Description:
  742.              Done is usually called automatically  by  object  methods
  743.          within the Presento and Boxo objects.  Done replaces a pop-up
  744.          box  (such as presented by GetAnyKey, GetYN, Dialog and Menu)
  745.          which what was originally  under  it  on  the  screen.   Done
  746.          restores  all  RAM  which  had  been  held for the underlying
  747.          image. Done automatically calls ClearSents.
  748.  
  749.          Considerations:
  750.          Done  must  be  called manually when you use Presento.Init or
  751.          Boxo.Init.
  752.  
  753.          See Also:
  754.          Init, Present, GetAnyKey, GetYN, Dialog, Menu, ClearSents.
  755.  
  756.  
  757.          Example:
  758.          program test;
  759.          uses magic;
  760.          begin
  761.             Pile('test');
  762.             Present.Init(-1,-1);
  763.             .
  764.             .
  765.             Present.Done;
  766.             .
  767.             .
  768.          end.
  769.          *************************************************************
  770.          EGAHiVideo - Procedure
  771.  
  772.          Description:
  773.          This initializes the system in EGA high-resolution 640 x  350
  774.          16-color   graphics   mode.   EGA   video   driver   will  be
  775.          automatically  compiled   into   the   .EXE   program   file,
  776.          eliminating the need for external EGAVGA.BGI file.
  777.  
  778.          Considerations:
  779.              The resulting .EXE file is much smaller than one compiled
  780.          after  a  call  to  BestVideo.  BestVideo builds all graphics
  781.          drivers into the .EXE file, but EGAHiVideo builds in only the
  782.          EGAVGA driver.  This  must  be  called  only  once  during  a
  783.          program. Video.Tpu must be available until after compilation.
  784.  
  785.              There  are  several graphmodes available for EGA. See the
  786.          Borland manuals.
  787.  
  788.          See Also:
  789.          BestVideo,  HercVideo,   CGAHiVideo,   CGALoVideo,   VGAVido,
  790.          EGALoVideo,  SVGAVideo  {Magic}; SetGraphMode, Setcolor, etc.
  791.          {Borland}
  792.  
  793.          Example:
  794.          Program Test;
  795.          uses crt, graph, magic;
  796.          begin
  797.             EGAHiVideo;
  798.             rectangle(10,10,20,20);
  799.             repeat until keypressed;
  800.             CleanUp;
  801.          end.
  802.  
  803.          Performance of example:
  804.          The  system  is  put  in EGA high-resolution graphics mode. A
  805.          small rectangle is displayed in the upper left corner of  the
  806.          screen until any key is pressed.  The program then terminates
  807.          gracefully.  Crt  must be in the Uses line because Keypressed
  808.          is a procedure within the Crt unit (Turbo.tpl).
  809.          *************************************************************
  810.          EGALoVideo - Procedure
  811.  
  812.          Description:
  813.          This  initializes the system in EGA Low-resolution 640 x  200
  814.          16-color   graphics   mode.   EGA   video   driver   will  be
  815.          automatically  compiled   into   the   .EXE   program   file,
  816.          eliminating the need for external EGAVGA.BGI file.
  817.  
  818.          Considerations:
  819.              The resulting .EXE file is much smaller than one compiled
  820.          after  a  call  to  BestVideo.  BestVideo builds all graphics
  821.          drivers into the .EXE file, but EGALoVideo builds in only the
  822.          EGAVGA driver.  This  must  be  called  only  once  during  a
  823.          program. Video.Tpu must be available until after compilation.
  824.  
  825.              There  are  several graphmodes available for EGA. See the
  826.          Borland manuals.
  827.  
  828.          See Also:
  829.          BestVideo,  HercVideo,   CGAHiVideo,   CGALoVideo,   VGAVido,
  830.          EGAHiVideo,  SVGAVideo  {Magic}; SetGraphMode, Setcolor, etc.
  831.          {Borland}
  832.  
  833.          Example:
  834.          Program Test;
  835.          uses crt, graph, magic;
  836.          begin
  837.             EGALoVideo;
  838.             rectangle(10,10,20,20);
  839.             repeat until keypressed;
  840.             CleanUp;
  841.          end.
  842.  
  843.          Performance of example:
  844.          The system is put in  EGA  low-resolution  graphics  mode.  A
  845.          small  rectangle is displayed in the upper left corner of the
  846.          screen until any key is pressed.  The program then terminates
  847.          gracefully.  Crt must be in the Uses line because  Keypressed
  848.          is a procedure within the Crt unit (Turbo.tpl).
  849.          *************************************************************
  850.          European - Procedure
  851.  
  852.          Description:
  853.              Causes  OutText,  and  OutTextXY  to  use  the "European"
  854.          stroked font.  It builds the font into the .EXE file.
  855.  
  856.          Considerations:
  857.              European  is  font  #9,  so  you  can use SetTextStyle as
  858.          follows: settextstyle(9,0,size).
  859.  
  860.          See Also:
  861.          Triplex,  Little,  Sansserif,  Gothic,  Script, Italic, Bold,
  862.          Simple,  Lcom,  BitMap  {Magic}  Settextstyle,   DefaultFont,
  863.          SetUserCharSize {Borland}
  864.  
  865.          Example:
  866.          program test;
  867.          uses graph, magic;
  868.          begin
  869.             vgahivideo;
  870.             European;
  871.             OutTextXY(0,10,'This is European font');
  872.             WaitForUser;
  873.             CleanUp;
  874.          end.
  875.          *************************************************************
  876.          FigureHowLong - Procedure
  877.  
  878.          Description:
  879.          FigureHowLong  determines  the width of the longest string in
  880.          the array Sent[].  First, it calls FigureHowMany to determine
  881.          how many strings there are,  then  sets  the  global  integer
  882.          variable HowLong. If in text mode, HowLong is the  number  of
  883.          characters  in  the  longest  string.   In any graphics mode,
  884.          HowLong represents the string  length  in  number  of  pixels
  885.          (characters * 8).
  886.  
  887.          Considerations:
  888.          FigureHowLong  is  called  automatically  by  the  methods in
  889.          Presento such as Init, GetYN, GetAnyKey, Dialog, and Menu.
  890.  
  891.          See Also:
  892.          Sent, Dialog, Menu, HowMany, FigureHowMany, Present.
  893.  
  894.          Example:
  895.          program test;
  896.          uses magic;
  897.          begin
  898.             Pile('xxx');
  899.             Pile('yyy');
  900.             .
  901.             .
  902.             FigureHowLong;
  903.             write('The longest string in Sent[] is ',HowLong,' long');
  904.          end.
  905.  
  906.          *************************************************************
  907.          FigureHowMany - Procedure
  908.  
  909.          Description:
  910.          FigureHowMany counts the number  of  strings  in  the  global
  911.          array  Sent[]  and  sets  the global byte variable HowMany to
  912.          that number.
  913.  
  914.          Considerations:
  915.          FigureHowMany is called automatically by the  pop-up  methods
  916.          in the Presento object such as Init, Menu, GetAnyKey, Dialog,
  917.          and GetYN.
  918.  
  919.          See Also:
  920.          FigureHowLong, Present, GetYN, GetAnyKey, Dialog, Menu, Init,
  921.          HowLong, HowMany.
  922.  
  923.          Example:
  924.          program test;
  925.          uses magic;
  926.          begin
  927.             Pile('xxx');
  928.             Pile('yyy');
  929.             .
  930.             .
  931.             FigureHowMany;
  932.             writeln(HowMany,' strings will pop-up in the next box.');
  933.          end.
  934.          *************************************************************
  935.          FileEcho - Procedure
  936.  
  937.          Description:
  938.          FileEcho  writes  a  string  to  OutFile  and to the monitor.
  939.          OutFile is a file of type text predeclared in the Magic unit.
  940.          If not renamed, the default file name for OutFile is  Output.
  941.          Opening  and  closing of OutFile is handled automatically. If
  942.          OutFile does not exist on disk, it is created.   If  it  does
  943.          exist, the string is added to the end of the file.
  944.  
  945.          Considerations:
  946.          FileEcho does not add carriage return/line feed to the end of
  947.          the  string.   If  the file is unaccessible (write protected,
  948.          disk full, etc) then the global byte variable Problem becomes
  949.          greater than 0.
  950.  
  951.          See Also:
  952.          NameOutFile, FileEchoLn, FileWrite, FileWriteLn.
  953.  
  954.          Example:
  955.          program test;
  956.          uses magic;
  957.          var
  958.             t : byte;
  959.          begin
  960.             Pile('Line #1');
  961.             Pile('Line #2');
  962.             Pile('Line #3');
  963.             for t := 1 to 3 do FileEcho(Sent[t]);
  964.          end.
  965.  
  966.          Performance of example:
  967.          This  text  is  written  to  the monitor and to a file called
  968.          OUTPUT on disk:
  969.  
  970.          Line #1Line #2Line #3
  971.          *************************************************************
  972.          FileEchoLn - Procedure
  973.  
  974.          Description:
  975.          FileEchoLn  writes  a  string  to  OutFile  and to the monitor.
  976.          OutFile is a file of type text predeclared in the Magic unit.
  977.          If not renamed, the default file name for OutFile is  Output.
  978.          Opening  and  closing of OutFile is handled automatically. If
  979.          OutFile does not exist on disk, it is created.   If  it  does
  980.          exist, the string is added to the end of the file.
  981.  
  982.          Considerations:
  983.          FileEchoLn adds a carriage return/line feed to the end of
  984.          the  string.   If  the file is unaccessible (write protected,
  985.          disk full, etc) then the global byte variable Problem becomes
  986.          greater than 0.
  987.  
  988.          See Also:
  989.          NameOutFile, FileEcho, FileWrite, FileWriteLn.
  990.  
  991.          Example:
  992.          program test;
  993.          uses magic;
  994.          var
  995.             t : byte;
  996.          begin
  997.             Pile('Line #1');
  998.             Pile('Line #2');
  999.             Pile('Line #3');
  1000.             for t := 1 to 3 do FileEchoLn(Sent[t]);
  1001.          end.
  1002.  
  1003.          Performance of example:
  1004.          This  text  is  written  to  the monitor and to a file called
  1005.          OUTPUT on disk:
  1006.  
  1007.          Line #1
  1008.          Line #2
  1009.          Line #3
  1010.          *************************************************************
  1011.          FileRead - Function : char
  1012.  
  1013.          Description:
  1014.             FileRead  is  a  function  that  automatically  reads  one
  1015.          character  from a pre-declared text file. Opening and closing
  1016.          the textfile is automatic. Only one character is read and the
  1017.          next call to FileRead will get  the  next  character  in  the
  1018.          file.  To get the very first character in the file, Reset the
  1019.          file before calling FileRead.
  1020.  
  1021.          Considerations:
  1022.          The file is called 'InFile' within the program, but must have
  1023.          an external name under which it will be stored on  disk.  You
  1024.          must  first  call  NameInFile, before using FileRead, or else
  1025.          the program will try to read a file with the default external
  1026.          name of 'INPUT.' If there is an error,  such  as  trying  to
  1027.          read  past  the  end of the file, or reading a file that does
  1028.          not exist, FileRead will return a char  #0,  and  the  global
  1029.          byte variable "Problem" will greater than 0.
  1030.  
  1031.          See Also:
  1032.          NameInFile, FileReadLn, Problem {Magic} Reset, EOF {Borland}
  1033.  
  1034.          Example:
  1035.          Program Reader;
  1036.          uses magic;
  1037.          var a : integer;
  1038.          begin
  1039.             XClear;
  1040.             NameInFile('sample.doc');
  1041.             for a := 1 to 1000 do write(FileRead);
  1042.          end.
  1043.  
  1044.          Performance of example:
  1045.          The screen is cleared. The file to read will be 'Sample.Doc'.
  1046.          Assuming  the  file  exists,  the  first 1000 characters from
  1047.          that file will be displayed on the screen, then  the  program
  1048.          ends.
  1049.          *************************************************************
  1050.          FileReadLn - Function : string
  1051.  
  1052.          Description:
  1053.             FileReadLn is a function that automatically reads one line
  1054.          from  a  pre-declared  text  file.   Opening  and closing the
  1055.          textfile is automatic.  Only one line is read  and  the  next
  1056.          call  to  FileReadLn  will get the next line in the file.  To
  1057.          get the very first line in the file, Reset  the  file  before
  1058.          calling  FileRead.  A  line  is  defined  as  having carriage
  1059.          return/linefeed at the end (char #13,#10).
  1060.  
  1061.          Considerations:
  1062.          The file is called 'InFile' within the program, but must have
  1063.          an external name under which it will be stored on  disk.  You
  1064.          must first call NameInFile, before using FileReadLn, or  else
  1065.          the program will try to read a file with the default external
  1066.          name of 'INPUT.' If there is an error, such as trying to read
  1067.          past  the  end  of  the file, or reading a file that does not
  1068.          exist, FileReadLn will return a char #0, and the global  byte
  1069.          variable, "Problem" will be greater than 0.
  1070.  
  1071.          See Also:
  1072.          NameInFile, FileReadLn, Problem {Magic} Reset, EOF {Borland}
  1073.  
  1074.          Example:
  1075.          Program Reader;
  1076.          uses magic;
  1077.          var a : integer;
  1078.          begin
  1079.             XClear;
  1080.             NameInFile('sample.doc');
  1081.             for a := 1 to 10 do writeln(FileReadLn);
  1082.          end.
  1083.  
  1084.          Performance of example:
  1085.          The screen is cleared. The file to read will be 'Sample.Doc'.
  1086.          Assuming  the  file exists, the first 10 lines from that file
  1087.          will be displayed on the screen, then the program ends.
  1088.          *************************************************************
  1089.          FileWrite - Procedure
  1090.  
  1091.          Description:
  1092.              FileWrite   will   write  a string into the standard text
  1093.          output    file.   Opening  and  closing  the  file is handled
  1094.          automatically.  If  the  file  exists,  the  string  will  be
  1095.          appended  to  the end.  If the file does not exist it will be
  1096.          created. Carriage return/linefeed is not added to the end  of
  1097.          the string.
  1098.  
  1099.          Considerations:
  1100.          The  standard  text  output  file  is called 'OutFile' within
  1101.          Pascal, but must have an external name under which it will be
  1102.          stored on disk.  You  must  first  call  NameOutFile,  before
  1103.          using  FileWrite, or else the program will write to file with
  1104.          the default external name of 'OUTPUT.' If there is an  error,
  1105.          nothing will be written to disk and the global byte variable,
  1106.          Problem will be greater than 0.  Only one string or character
  1107.          can  be  written  to  the  output  file with a single call to
  1108.          FileWrite. No numerical values can be written unless they are
  1109.          first converted to a string.
  1110.  
  1111.          See Also:
  1112.          NameOutFile,  FileWriteLn,  FileEcho,   FileEchoLn,   Problem
  1113.          {Magic} Str {Borland}
  1114.  
  1115.          Example:
  1116.          Program Writer;
  1117.          uses magic;
  1118.          begin
  1119.             NameOutFile('sample.doc');
  1120.             FileWrite('This is a sample text file.');
  1121.             FileWrite('This is a second string of text.');
  1122.          end.
  1123.  
  1124.          Performance of example:
  1125.          The  standard  text file is renamed 'Sample.Doc.' Two strings
  1126.          are written to the file then the program ends.  If there  was
  1127.          no  previous  file  by  that  name,  Sample.Doc  is  created,
  1128.          otherwise  the  line is appended to the end of the other text
  1129.          in the file. If you look at Sample.Doc with a word  processor
  1130.          or  text  editor  or  Turbo Pascal IDE, you will see the last
  1131.          line in the file is: 'This is a sample text file.  This is  a
  1132.          second string of text.'
  1133.  
  1134.          *************************************************************
  1135.          FileWriteLn - Procedure
  1136.  
  1137.          Description:
  1138.              FileWriteLn  will  write  a string into the standard text
  1139.          output  file.   Opening  and  closing  the  file  is  handled
  1140.          automatically.   If  the  file  exists,  the  string  will be
  1141.          appended to the end.  If the file does not exist it  will  be
  1142.          created.  Carriage return/linefeed is added to the end of the
  1143.          string.
  1144.  
  1145.          Considerations:
  1146.          The  standard  text  output  file  is called 'OutFile' within
  1147.          Pascal, , but must have an external name under which it  will
  1148.          be  stored  on disk.  You must first call NameOutFile, before
  1149.          using FileWrite, or else the program will write to file  with
  1150.          the  default external name of 'OUTPUT.' If there is an error,
  1151.          nothing will be written to disk and the global byte variable,
  1152.          Problem  will  be  greater  than  0.   Only  one  string   or
  1153.          character  can  be  written  to the output file with a single
  1154.          call to FileWriteLn.  No  numerical  values  can  be  written
  1155.          unless they are first converted to a string.
  1156.  
  1157.          See Also:
  1158.          NameOutFile,   FileWrite,   FileEcho,   FileEchoLn,   Problem
  1159.          {Magic} Str {Borland}
  1160.  
  1161.          Example:
  1162.          Program Writer;
  1163.          uses magic;
  1164.          begin
  1165.             NameOutFile('sample.doc');
  1166.             FileWriteLn('This is a sample text file.');
  1167.             FileWriteLn('This is a second string of text.');
  1168.          end.
  1169.  
  1170.          Performance of example:
  1171.          The standard text file is renamed 'Sample.Doc.'  Two  strings
  1172.          are  written to the file then the program ends.  If there was
  1173.          no  previous  file  by  that  name,  Sample.Doc  is  created,
  1174.          otherwise  the  line is appended to the end of the other text
  1175.          in the file. If you look at Sample.Doc with a word  processor
  1176.          or  text  editor  or  Turbo Pascal IDE, you will see the last
  1177.          lines in the file are:
  1178.              'This is a sample text file.
  1179.               This is a second string of text.'
  1180.  
  1181.          *************************************************************
  1182.          ForceMode - Global Variable - Byte
  1183.  
  1184.          Description:
  1185.          ForceMode is used by the  PutPCX  procedure.   It  tells  the
  1186.          procedure  how  to  handle  video modes for displaying a .PCX
  1187.          file:
  1188.  
  1189.          ForceMode  Action taken by PutPCX
  1190.          =========  ================================================
  1191.              0       Set VMode as required by .PCX picture (default)
  1192.              1       Set VMode to 1, CGA-Hi 640 x 200 2-color
  1193.              2       Set VMode to 2, CGA-Lo 320 x 200 4-color
  1194.              3       Set VMode to 3, EGA-Lo 640 x 200 16-color
  1195.              4       Set VMode to 4, EGA-Hi 640 x 350 16-color
  1196.              5       Set VMode to 5, Hercules 720 x 348 2-color
  1197.              6       Set VMode to 6, VGA-Hi 640 x 480 16-color
  1198.              7       Set VMode to 7, VGA-Lo 320 x 200 256-color
  1199.              8       Set VMode to 8, Super-VGA 640 x 480 256-color
  1200.             99       Does not change VMode
  1201.  
  1202.          Considerations:
  1203.          Using  1-8  means  you  must  manually choose a correct video
  1204.          mode, or system may  crash.   Using  99,  means  system  must
  1205.          already be set to correct video mode or system may crash.
  1206.  
  1207.          See Also:
  1208.          PutPCX, VMode
  1209.  
  1210.          Example:
  1211.          program test;
  1212.          uses magic;
  1213.          begin
  1214.             .
  1215.             .
  1216.             ForceMode := 7;
  1217.             PutPCX('Earth',true);
  1218.             WaitForUser;
  1219.          end.
  1220.          *************************************************************
  1221.          GetAnyKey - Object Method
  1222.  
  1223.          Description:
  1224.              This is for pop-up notices. A  message  pops  up  on  the
  1225.          screen  then  waits  for the user to press any key or click a
  1226.          mouse button. You must write strings for the array of Sent[]s
  1227.          before  calling this procedure. After the user presses a key,
  1228.          all traces of the pop-up and the Sent[]s disappear.
  1229.              GetAnyKey  requires  two  integer  variables,  the  first
  1230.          determines the horizontal position on  the  screen,  and  the
  1231.          second  is  the  vertical  coordinate.  If  either  number is
  1232.          negative, the pop-up message will be centered on  the  screen
  1233.          in the corresponding dimension.
  1234.              An   instance  of  the  object  Presento  which  contains
  1235.          GetAnyKey, has been precreated in the Magic unit.  It's  name
  1236.          is   Present.    Typical   use  of  GetAnyKey  is  with  this
  1237.          pre-created instance as follows:
  1238.  
  1239.          Present.GetAnyKey(-1,-1);
  1240.  
  1241.          Considerations:
  1242.             Maximum Sent array size: 18. Make sure to add something to
  1243.          this effect to every message to avoid confusing  your  users:
  1244.          "Press any key to continue..."
  1245.             GetAnyKey calls it's own destructor when done, eliminating
  1246.          all traces of itself from RAM when done.
  1247.  
  1248.          See Also:
  1249.          Menu, Present, Init, Dialog, GetYN, Sent[].
  1250.  
  1251.          Example:
  1252.          Program Test;
  1253.          uses magic;
  1254.          begin
  1255.             .
  1256.             .
  1257.             Sent[1] := 'You have selected an option available only';
  1258.             Sent[2] := 'to registered users. Please send money!!!';
  1259.             Sent[3] := 'Press any key to continue...';
  1260.             Present.GetAnyKey(-1,-1);
  1261.             .
  1262.             .
  1263.          end.
  1264.  
  1265.          Performance of example:
  1266.              A box pops up on the screen containing three lines,  then
  1267.          disappears  without  a trace when the user presses any key or
  1268.          clicks a mouse button.
  1269.          *************************************************************
  1270.          GetYN - Object Method
  1271.  
  1272.          Description:
  1273.               A message pops up on the screen then waits for the  user
  1274.          to  press  'Y' or 'N' or click a mouse button. You must write
  1275.          strings  for  the  array  of  Sent[]s  before  calling   this
  1276.          procedure.  After  the  user presses a key, all traces of the
  1277.          pop-up and the Sent[]s disappear.
  1278.              GetYN  requires  two   integer   variables,   the   first
  1279.          determines  the  horizontal  position  on the screen, and the
  1280.          second is the  vertical  coordinate.   If  either  number  is
  1281.          negative,  the  pop-up message will be centered on the screen
  1282.          in the corresponding dimension.
  1283.              GetYN  sets  the  global  string,  Answer, to 'Y' or 'N'.
  1284.          Also, the global char U is set to 'Y' or 'N.'
  1285.              GetYN is a method of the object Presento.  An instance of
  1286.          Presento,  called  Present  has  been precreated in the Magic
  1287.          Unit.
  1288.  
  1289.          Considerations:
  1290.             Maximum Sent array size: 18. Make sure to add something to
  1291.          this effect to every message to avoid confusing  your  users:
  1292.          "Press [Y] or [N]..." GetYN is not case sensitive.  The  user
  1293.          can type upper or lower case [y] or [n]. If  the  left  mouse
  1294.          button is clicked Answer is set to 'Y' and if the right mouse
  1295.          button is  clicked  Answer  =  'N'.   GetYN  calls  it's  own
  1296.          destructor  when  done, eliminating all traces of itself from
  1297.          RAM.
  1298.  
  1299.          See Also:
  1300.          Menu, Present.Init, Dialog, GetYN, Sent[], Answer, u.
  1301.  
  1302.          Example:
  1303.          Program Test;
  1304.          uses magic;
  1305.          begin
  1306.             .
  1307.             .
  1308.             Sent[1] := 'Exit to Dos? (Y/N)';
  1309.             Present.GetYN(-1,1);
  1310.             if Answer = 'Y' then
  1311.             begin
  1312.                CleanUp;
  1313.                halt;
  1314.             end;
  1315.             .
  1316.             .
  1317.          end.
  1318.  
  1319.          Performance of example:
  1320.              A box pops up on the screen containing one line and waits
  1321.          for the user to press a key. Until the key pressed  is  upper
  1322.          or lower case 'Y' or 'N', or until the user  clicks  a  mouse
  1323.          key,  the box remains. Then the global string, Answer, is set
  1324.          to 'Y' or 'N.' If Answer = 'N' then  the  program  terminates
  1325.          cleanly.
  1326.          *************************************************************
  1327.          Gothic - Procedure
  1328.  
  1329.          Description:
  1330.              Calling  the  procedure  Gothic  makes the Borland Gothic
  1331.          font available to graphic-based programs. This font  will  be
  1332.          compiled  into  the  .EXE  file.  GOTHIC.CHR does not have to
  1333.          accompany the finished product.
  1334.  
  1335.          Considerations:
  1336.          Compiled .EXE size increases by about 17k. Dimensions of  the
  1337.          Gothic   font   can   be   changed   with   SetTextStyle  and
  1338.          SetUserCharSize.  Gothic   is   font   #4   (for   use   with
  1339.          SetTextStyle).
  1340.  
  1341.          See Also:
  1342.          SansSerif, BitMap, Triplex, Little, Italic, Script, European,
  1343.          Lcom,  Simple,  Bold  {Magic}  SetUserCharSize,  SetTextStyle
  1344.          {Borland}
  1345.  
  1346.          Example:
  1347.          Program Test;
  1348.          uses crt, graph, magic;
  1349.          begin
  1350.             BestVideo;
  1351.             Gothic;
  1352.             OutTextXY(0,0,'Regular-size Gothic');
  1353.             SetTextStyle(4,0,9);
  1354.             OutTextXY(100,100,'Huge');
  1355.             WaitForUser;
  1356.          end.
  1357.          *************************************************************
  1358.          HercVideo - Procedure
  1359.  
  1360.          Description:
  1361.          This  initializes  the  system  in  Hercules  graphics  mode.
  1362.          Hercules video driver will be automatically compiled into the
  1363.          .EXE program file, eliminating the need for external Herc.BGI
  1364.          file.
  1365.  
  1366.          Considerations:
  1367.              The resulting .EXE file is much smaller than one compiled
  1368.          after  a  call  to  BestVideo.  BestVideo builds all graphics
  1369.          drivers into the .EXE file, but HercVideo builds in only  the
  1370.          Herc.BGI  driver.   Video.Tpu  must  be available until after
  1371.          compilation. There is only one GraphMode for Hercules,  which
  1372.          is  0.   With  many VGA cards, you must leave  Turbo  Pascal,
  1373.          specifically run  the  video  card  software  to  set  it  to
  1374.          Hercules mode, then compile and run your program.
  1375.  
  1376.          See Also:
  1377.          BestVideo,  CGAHiVideo,  CGALoVideo,  EGAHiVideo, EGALoVideo,
  1378.          Vgahivideo,  VGALoVideo,  SVGAVideo  {Magic};   SetGraphMode,
  1379.          Setcolor, etc. {Borland}
  1380.  
  1381.          Example:
  1382.          Program Test;
  1383.          uses crt, Graph, Magic;
  1384.          begin
  1385.             HercVideo;
  1386.             rectangle(10,10,20,20);
  1387.             WaitForUser;
  1388.             CleanUp;
  1389.          end.
  1390.  
  1391.          Performance of example:
  1392.          The  system  is  put  in  Hercules  graphics  mode.  A  small
  1393.          rectangle is displayed in the upper left corner of the screen
  1394.          until any  key  is  pressed.   The  program  then  terminates
  1395.          gracefully. Crt must be in the Uses line  because  Keypressed
  1396.          is a procedure within the Crt unit (Turbo.tpl).
  1397.          *************************************************************
  1398.          HideCursor - Procedure
  1399.  
  1400.          Description:
  1401.          This  makes the cursor disappear until it is moved to another
  1402.          screen location. Generally,  use  it  after  writing  to  the
  1403.          screen when the user is not to type input.
  1404.  
  1405.          Considerations:
  1406.             For text mode only, has no effect in graphics.
  1407.  
  1408.          Example:
  1409.          Program Test;
  1410.          uses magic;
  1411.          begin
  1412.             write('There is no cursor at the end of this line.');
  1413.             HideCursor;
  1414.             U := xreadkey;
  1415.          end.
  1416.  
  1417.          Performance of example:
  1418.             A  line  of  text  appears  on the screen, but there is no
  1419.          cursor at the end of the line.
  1420.          *************************************************************
  1421.          HowLong - Global Variable - Integer
  1422.  
  1423.          Description:
  1424.          This integer is used to  keep  track  of  the  width  of  the
  1425.          longest string in the array Sent[]. HowLong is updated by the
  1426.          procedure FigureHowLong.
  1427.  
  1428.          Considerations:
  1429.          Direct modification of this variable is not recommended.
  1430.  
  1431.          See Also:
  1432.          FigureHowLong, FigureHowMany, HowMany, Sent
  1433.          *************************************************************
  1434.          HowMany - Global Variable - Byte
  1435.  
  1436.          Description:
  1437.          This  integer  is used to keep track of the number of strings
  1438.          within the array  Sent[]  which  contain  text.   HowMany  is
  1439.          updated by the procedure FigureHowMany.
  1440.  
  1441.          Considerations:
  1442.          Direct modification of this variable is not recommended.
  1443.  
  1444.          Example:
  1445.          program test;
  1446.          uses magic;
  1447.          begin
  1448.             Pile('xxx');
  1449.             Pile('yyy');
  1450.             .
  1451.             .
  1452.             FigureHowMany;
  1453.             if HowMany > 13 then GetAnyKey(-1,-1);
  1454.          end.
  1455.          *************************************************************
  1456.          InFile - Global Variable
  1457.  
  1458.          Description:
  1459.             InFile  is declared globally as a file of type Text. It is
  1460.          used for importing information into  your  program  with  the
  1461.          automatic procedures FileRead and FileReadLn.
  1462.  
  1463.          Considerations:
  1464.             InFile  is  for  text  only.   Numeric  values   will   be
  1465.          represented  as  strings  in  InFile.   You  can override the
  1466.          automatic use of InFile with standard Turbo Pascal techniques
  1467.          such as Assign, ReWrite and Close.
  1468.             InFile is assigned the disk filename of INPUT by default.
  1469.          This may be changed with NameInFile.
  1470.  
  1471.          See Also:
  1472.          FileWrite,  FileWriteLn,  FileEcho,  FileEchoLn,  NameInFile,
  1473.          OutFile  {Magic};  Assign,  ReWrite,  ReSet,  Append,  Write,
  1474.          WriteLn, Read, ReadLn, Rename, Erase, Close {Borland}
  1475.  
  1476.          Example:
  1477.          Program Test;
  1478.          uses magic;
  1479.          begin
  1480.             NameInFile('TestFile.Txt');
  1481.             ReWrite(InFile);
  1482.             close(InFile);
  1483.          end.
  1484.  
  1485.          Performance of example:
  1486.             This nasty little program makes sure that if  there  is  a
  1487.          file  called  'TestFile.Txt'  it will contain no information,
  1488.          since ReWriting a file wipes out any previous version of that
  1489.          file.
  1490.          *************************************************************
  1491.          InFileName - Global Variable - string[60]
  1492.  
  1493.          Description:
  1494.          InFileName  is  a  string  to  hold the disk filename for the
  1495.          predeclared text file, InFile.
  1496.  
  1497.          See Also:
  1498.          NameInFile, NameOutFile, FileRead, FileReadLn.
  1499.  
  1500.          Example:
  1501.          program test;
  1502.          uses magic;
  1503.          begin
  1504.             Pile('Type name of disk file:');
  1505.             Present.Dialog(-1,-1);
  1506.             NameInFile(Answer);
  1507.             Answer := FileReadLn;
  1508.             if Problem > 0 then writeln('File does not exist');
  1509.             WaitForUser;
  1510.          end.
  1511.          *************************************************************
  1512.          Init - Object Method
  1513.  
  1514.          Description:
  1515.          Init is usually used with the object Presento, and  with  the
  1516.          predeclared  instance Present. Init makes a box on the screen
  1517.          containing whatever text  exists  in  the  array  of  strings
  1518.          Sent[].  Init requires two parameters, an x and y location on
  1519.          the  screen.   If  in text mode, the upper left corner of the
  1520.          screen is 1,1 and the  lower  right  is  80,25.   You  cannot
  1521.          actually use Present.Init(80,25), because the box itself will
  1522.          require some space.  In graphics modes, the upper left screen
  1523.          position  is  0,0  and  the lower right varies with the video
  1524.          mode.  CGA High-resolution, for instance, is 639,199.  If you
  1525.          pass any negative integer to Init for an x location, the  box
  1526.          will  be  centered horizontally on the screen, and a negative
  1527.          number for a y coordinate results in  a  vertically  centered
  1528.          box.  The  destructor  Done  will  make  the  box  disappear,
  1529.          restoring what it had covered up.
  1530.  
  1531.          Considerations:
  1532.          In  most  cases,  using  more  than 18 strings in Sent[] will
  1533.          result  in a box larger than will fit on the screen. (Crash!)
  1534.          In text mode, up to 10  layers  of  Init,  GetYN,  GetAnyKey,
  1535.          Menu  or Dialog may be placed over each other.  When each one
  1536.          is finished, what it covered will be restored.   In  graphics
  1537.          modes,  there is only one layer possible for each instance of
  1538.          Presento.  You can create more  instances  of  Presento,  but
  1539.          there  is a limit to the amount of RAM available. You must be
  1540.          careful not to save so much graphics screen information  with
  1541.          several instances that you use up the 640k RAM space.
  1542.              Methods  GetAnyKey,  GetYn, Dialog and Menu automatically
  1543.          save the graphics  text  settings  before  changing  them  to
  1544.          standardize the output of pop-up boxes.  Then they change the
  1545.          graphics  text  settings  back  when  done.  Init does not do
  1546.          that.   You  should   save   the   settings   manually   with
  1547.          Settings.Save  and  Settings.Restore,  if  you do not want to
  1548.          affect   current    settings    of    TextStyle,    ViewPort,
  1549.          Text Justification, LineStyle and Color.
  1550.  
  1551.          See Also:
  1552.          Present,  GetYN,  GetAnyKey,  Dialog,  Menu,  Sent, Settings,
  1553.          Restore, Save
  1554.  
  1555.          Example:
  1556.          program test;
  1557.          uses magic;
  1558.          begin
  1559.             Pile('This is a noisy test');
  1560.             Present.Init(-1,2);
  1561.             Bugle;
  1562.             Present.Done;
  1563.          end.
  1564.          *************************************************************
  1565.          Italic - Procedure
  1566.  
  1567.          Description:
  1568.          Calling  the procedure Italic makes the Italic font available
  1569.          to graphic-based programs.  This font will be  compiled  into
  1570.          the .EXE file.
  1571.  
  1572.          Considerations:
  1573.          Compiled  .EXE size increases by about 17k. Dimensions of the
  1574.          Italic  font   can   be   changed   with   SetTextStyle   and
  1575.          SetUserCharSize.    Italic   is   font   #7   (for  use  with
  1576.          SetTextStyle).
  1577.  
  1578.          See Also:
  1579.          SansSerif,  Triplex,  BitMap,  Little,  European, Bold, Lcom,
  1580.          Simple, Script, Gothic {Magic} SetUserCharSize,  SetTextStyle
  1581.          {Borland}
  1582.  
  1583.          Example:
  1584.          Program Test;
  1585.          uses crt, graph, magic;
  1586.          begin
  1587.             BestVideo;
  1588.             Italic;
  1589.             OutTextXY(0,0,'Regular-size Italic');
  1590.             SetTextStyle(7,0,9);
  1591.             OutTextXY(100,100,'Huge');
  1592.             WaitForUser;
  1593.          end.
  1594.          *************************************************************
  1595.          KeyDetect - Global Variable - byte;
  1596.  
  1597.          Description:
  1598.          KeyDetect  is used to determine the nature of a response from
  1599.          the procedure Poll.  If KeyDetect = 0 then a the keyboard has
  1600.          not been touched (perhaps a mouse action  has  occurred).  If
  1601.          KeyDetect  =  1  then  a  regular  alphanumeric  key has been
  1602.          pressed.  If KeyDetect = 2 then  an  extended  key  has  been
  1603.          pressed ([F1] - [F12], etc).
  1604.  
  1605.          Considerations:
  1606.          KeyDetect does not change until Poll is called.
  1607.  
  1608.          See Also:
  1609.          Poll.
  1610.  
  1611.          Example:
  1612.          program help;
  1613.          uses magic;
  1614.          begin
  1615.             .
  1616.             .
  1617.             repeat
  1618.               Poll;
  1619.               if (KeyDetect = 2) and (U = ';') then
  1620.                  writeln('[F1] has been pressed.');
  1621.             until Left;
  1622.          end.
  1623.          *************************************************************
  1624.          Lcom - Procedure
  1625.  
  1626.          Description:
  1627.              Calling  the  procedure  Lcom makes the Borland Lcom font
  1628.          available  to  graphic-based  programs.  This  font  will  be
  1629.          compiled  into  the  .EXE  file.   Lcom.CHR  does not have to
  1630.          accompany the finished product.
  1631.  
  1632.          Considerations:
  1633.          Compiled .EXE size increases by about 17k. Dimensions of  the
  1634.          Lcom    font   can   be   changed   with   SetTextStyle   and
  1635.          SetUserCharSize.    Lcom   is   font   #8   (for   use   with
  1636.          SetTextStyle).
  1637.  
  1638.          See Also:
  1639.          SansSerif, BitMap, Triplex, Little, Italic, Script, European,
  1640.          Gothic,  Simple,  Bold  {Magic} SetUserCharSize, SetTextStyle
  1641.          {Borland}
  1642.  
  1643.          Example:
  1644.          Program Test;
  1645.          uses crt, graph, magic;
  1646.          begin
  1647.             BestVideo;
  1648.             Lcom;
  1649.             OutTextXY(0,0,'Regular-size Lcom');
  1650.             SetTextStyle(8,0,9);
  1651.             OutTextXY(100,100,'Huge');
  1652.             WaitForUser;
  1653.          end.
  1654.          *************************************************************
  1655.          Left - Global Variable - boolean
  1656.  
  1657.          Description:
  1658.             Left is a global  boolean  variable  used  to  record  the
  1659.          status  of  the  left  mouse button.  If Left = true then the
  1660.          left  mouse  button  has  been pressed as of the last call to
  1661.          Poll.
  1662.  
  1663.          Considerations:
  1664.             The status of Left will change with every  call  to  Poll,
  1665.          Waste, ResetMouse or procedures  within  Magic  which  handle
  1666.          text or pop-up boxes.
  1667.  
  1668.          See Also: Poll, Waste, ResetMouse, Right, Center
  1669.  
  1670.          Example:
  1671.          Program Test;
  1672.          uses magic;
  1673.          var
  1674.             x, y : word;
  1675.          begin
  1676.             Sent[1] := 'Nothing will change until you click the';
  1677.             Sent[2] := 'left mouse button';
  1678.             Present.Init(-1,-1);
  1679.             Waste;
  1680.             repeat
  1681.                Poll;
  1682.             until Left;
  1683.             Present.Done;
  1684.          end.
  1685.  
  1686.          Performance of example:
  1687.             A box containing two lines of text will stay on the screen
  1688.          until the user clicks the left  mouse  button.   The  program
  1689.          will then terminate.
  1690.          *************************************************************
  1691.          Little - Procedure
  1692.  
  1693.          Description:
  1694.          Calling  the procedure Little makes the Little font available
  1695.          to graphic-based programs.  This font will be  compiled  into
  1696.          the .EXE file.
  1697.  
  1698.          Considerations:
  1699.          Compiled  .EXE size increases by about 17k. Dimensions of the
  1700.          Little  font   can   be   changed   with   SetTextStyle   and
  1701.          SetUserCharSize.    Italic   is   font   #2   (for  use  with
  1702.          SetTextStyle).
  1703.  
  1704.          See Also:
  1705.  
  1706.          Lcom,  Simple,  Bold,  SansSerif,  BitMap,  Triplex,  Italic,
  1707.          European,    Script,    Gothic    {Magic}    SetUserCharSize,
  1708.          SetTextStyle {Borland}
  1709.  
  1710.          Example:
  1711.          Program Test;
  1712.          uses crt, graph, magic;
  1713.          begin
  1714.             BestVideo;
  1715.             Little;
  1716.             OutTextXY(0,0,'Regular-size Little');
  1717.             SetTextStyle(2,0,9);
  1718.             OutTextXY(100,100,'Huge');
  1719.             WaitForUser;
  1720.          end.
  1721.          *************************************************************
  1722.          LittleCursor - Procedure
  1723.  
  1724.          Description:
  1725.          After a call to LittleCursor, the cursor in  text  mode  will
  1726.          be a block the size of an underline instead of a large block.
  1727.          The  little cursor size is the DOS default cursor. Therefore,
  1728.          this procedure is generally used as an antidote to BigCursor.
  1729.  
  1730.          Considerations:
  1731.             Will have no effect in graphics mode, but will resume as a
  1732.          little cursor when returned to text mode.
  1733.  
  1734.          See also: BigCursor.
  1735.  
  1736.          Example:
  1737.          program test;
  1738.          uses magic;
  1739.          begin
  1740.             .
  1741.             .
  1742.             BigCursor;
  1743.             .
  1744.             .
  1745.             LittleCursor;
  1746.             CleanUp;
  1747.          end.
  1748.  
  1749.          Performance of Example:
  1750.          This  program  will  switch to a block size cursor, then just
  1751.          before ending, it returns the cursor to the default size.
  1752.          *************************************************************
  1753.          MainBack - Global Variable - byte
  1754.  
  1755.          Description:
  1756.          This sets the background color for the main  portion  of  the
  1757.          screen, outside of pop-up boxes. 'Color' is an integer from 0
  1758.          to  15  or a color constant as defined by Borland. Do not use
  1759.          colors above 7 in text mode.
  1760.             MainBack is also used as  the  background  color  for  the
  1761.          procedure NText.
  1762.  
  1763.          Considerations:
  1764.          May  not  have the expected effect when used with the limited
  1765.          palettes of 4-color CGA (mode  0,1  or  2),  2-color  CGA  or
  1766.          Hercules. In text mode, since this  is  a  background  color,
  1767.          only 8 colors are available: 0 - 7.  After changing  a  video
  1768.          mode, MainBack will have no effect until a call to XClear.
  1769.  
  1770.          See   Also:  BarBack  BarText,  BoxBack,  BoxText,  MainText,
  1771.          Border, Shadow, NText
  1772.  
  1773.          Example:
  1774.          program test;
  1775.          uses magic;
  1776.          begin
  1777.             Sent[1] := 'First Thing';
  1778.             Sent[2] := 'Second Thing';
  1779.             Sent[3] := 'Quit';
  1780.             Mc := 1;
  1781.             MainBack := Red;
  1782.             XClear;
  1783.             Present.Menu(-1,-1);
  1784.             .
  1785.             .
  1786.          end.
  1787.  
  1788.          Performance of example:
  1789.          Three strings are declared, and a menu pops up.  Because of
  1790.          the preceding change to MainBack, then the call to XClear,
  1791.          the main background around the menu is red.
  1792.          *************************************************************
  1793.          MainText - Global Variable
  1794.  
  1795.          Description:
  1796.          This  sets the text color for the main portion of the screen,
  1797.          outside of pop-up boxes. 'Color' is an integer from 0  to  15
  1798.          or  a color constant as defined by Borland.  Colors  are  the
  1799.          same in graphics and text modes.
  1800.             MainText  is  also  used  as  the foreground color for the
  1801.          procedure NText.
  1802.  
  1803.          Considerations:
  1804.          May  not  have the expected effect when used with the limited
  1805.          palettes of 4-color CGA (mode  0,1  or  2),  2-color  CGA  or
  1806.          Hercules. No procedures in the  Magic  unit  use  this  color
  1807.          directly.
  1808.  
  1809.          See   also:  BarBack  BarText,  BoxBack,  BoxText,  MainBack,
  1810.          Border, Shadow
  1811.  
  1812.          Example:
  1813.          program test;
  1814.          uses magic;
  1815.          begin
  1816.             MainText:= LightGreen;
  1817.             textcolor(MainText);
  1818.             gotoxy(1,25);
  1819.             write('My Program, Copyright 1992, Your Company');
  1820.             Sent[1] := 'First Thing';
  1821.             Sent[2] := 'Second Thing';
  1822.             Sent[3] := 'Quit';
  1823.             Mc := 1;
  1824.             Present.Menu(-1,-1);
  1825.             .
  1826.             .
  1827.          end.
  1828.  
  1829.          Performance of example:
  1830.              MainText  is  used  as a variable to hold "red." The text
  1831.          foreground color is set to MainText (red) and then  a  string
  1832.          is  written  on  the  bottom line of the screen: "My Program,
  1833.          Copyright 1992, Your Company." Then a menu pops up.
  1834.          *************************************************************
  1835.          Mc - Global Variable - byte;
  1836.  
  1837.          Description:
  1838.          Mc  is  used  in conjunction with  the  Menu  procedure. When
  1839.          Menu is called, the highlighted item on the menu will be  Mc.
  1840.          So,  generally,  you  would  set Mc to 1 before calling Menu.
  1841.          When Menu is done, Mc becomes the number of the choice  which
  1842.          was highlighted when Menu fell through.
  1843.  
  1844.          Considerations:
  1845.          If  you forget to assign a value to Mc before calling Menu, a
  1846.          random choice will be highlighted, within the range possible.
  1847.  
  1848.          See Also:
  1849.          Menu
  1850.  
  1851.          Example:
  1852.          See Menu
  1853.          *************************************************************
  1854.          Menu - Object Method
  1855.  
  1856.          Description:
  1857.              Menu  pops a box on the screen showing lines of text from
  1858.          the array Sent[1..48].  (Actually only about 18  Sent[]s  are
  1859.          possible   in   most  video  modes.)  One  of  the  lines  is
  1860.          highlighted and a user can move the highlight to any  of  the
  1861.          other  items  by  moving the mouse or pressing the up or down
  1862.          arrow keys.  When the user presses [Enter] or clicks the left
  1863.          mouse  button,  the  currently  highlighted  item  number  is
  1864.          assigned  to  the  global  byte  variable  Mc. The pop-up box
  1865.          disappears and the array of strings, Sent[1..18] is cleared.
  1866.              Two integer parameters are required, the first  indicates
  1867.          the  horizontal  position  of  the  upper left corner and the
  1868.          second is for the vertical position.  If either integer is  a
  1869.          negative  number,   that integer will be ignored and the menu
  1870.          will   be   centered  on  the  screen  in  the  corresponding
  1871.          dimension.
  1872.              A string must also be passed to Menu.  If the  string  is
  1873.          blank  ('')  Menu  will  work  as  expected.   If  the string
  1874.          contains characters, then Menu will fall through if the  user
  1875.          presses  any  key  corresponding  to  any  characters  in the
  1876.          string.  This is how you can have the menu accept user  input
  1877.          when the user presses the first  letter  of  a  Menu  choice.
  1878.          Small  case  characters  in  the string will be automatically
  1879.          upcased.
  1880.              Before  calling Menu, a byte variable, Mc should be given
  1881.          a value.  Mc is the current MenuChoice,  meaning  the  Sent[]
  1882.          corresponding to Mc is the one highlighted.  If you state: Mc
  1883.          := 1 then the first item on the menu will be highlighted.  If
  1884.          you  forget  to  assign  Mc,  a  random  menu  choice will be
  1885.          highlighted with your first call to Menu.
  1886.               When  the  user  presses   any   non-arrow   key   which
  1887.          corresponds  to  a character in the string passed to Menu, or
  1888.          clicks a  mouse  button,  the  pop-up  Menu  disappears,  all
  1889.          Sent[]s  are  set  to  '',  and  U  will  have  a  char value
  1890.          corresponding to the key pressed.  If the left  mouse  button
  1891.          was  clicked  U  will be char #13 ([Enter]), and if the right
  1892.          button was pressed, U will be #27 ([Esc]).
  1893.              You can then use u or Mc to perform operations related to
  1894.          your user's choice. To have the Menu return  to  the  screen,
  1895.          Sent[]s  must  be refilled with your strings and Menu must be
  1896.          called again. The usual way to use Menu is to put it  into  a
  1897.          repeat loop as shown in the example below.
  1898.              Menu is a method within the Presento object.  An instance
  1899.          of Presento called Present, has been predeclared in the Magic
  1900.          unit, so a typical call to Menu looks like this:
  1901.  
  1902.          Present.Menu(x,y,'');
  1903.  
  1904.          Considerations:
  1905.             Maximum Sent[]s : 18; Should assign a value to  Mc  of  at
  1906.          least   one  and  less than the maximum Sent[]. Must reassign
  1907.          text to the Sent[]s for subsequent calls to  Menu.
  1908.             Menu uses the color variables  Border,  BoxBack,  BoxText,
  1909.          BarBack, and BarText.
  1910.             In  text  mode, BoxBack and BarBack colors above 7 are not
  1911.          supported.
  1912.  
  1913.          See also: Sent[], Present.Init, GetYN, GetAnyKey.
  1914.  
  1915.          Example:
  1916.          Program Test;
  1917.          uses magic;
  1918.          begin
  1919.             Mc := 1;
  1920.             repeat
  1921.                Sent[1] := 'Do Thing One';
  1922.                Sent[2] := 'Do Thing Two';
  1923.                Sent[3] := 'Do Thing tHree';
  1924.                Sent[4] := 'Do Thing Four';
  1925.                Sent[5] := 'Do Thing fiVe';
  1926.                Sent[6] := 'Do Thing Six';
  1927.                Sent[7] := '   Quit   ';
  1928.                Present.Menu(-1,-1);
  1929.                if Left then case Mc of
  1930.                   1 : Procedure1;
  1931.                   2 : Procedure2;
  1932.                   3 : Procedure3;
  1933.                   4 : Procedure4;
  1934.                   5 : Procedure5;
  1935.                   6 : Procedure6;
  1936.                   7 : Right := true;
  1937.                end; {case Mc}
  1938.                case u of    {must be upper case here}
  1939.                   'O' : Procedure1;
  1940.                   'T' : Procedure2;
  1941.                   'H' : Procedure3;
  1942.                   'F' : Procedure4;
  1943.                   'V' : Procedure5;
  1944.                   'S' : Procedure6;
  1945.                   'Q' : Right := true;
  1946.                end; {case u}
  1947.             until Right;
  1948.             CleanUp;
  1949.          end.
  1950.  
  1951.          Performance of example:
  1952.             Mc  is  set  to 1 so when the Menu pops up, the first item
  1953.          will be highlighted.  Seven Sent[]s are  given  strings.  The
  1954.          Menu  pops  up  and  the  user  presses a key or operates the
  1955.          mouse.  Then if Left is true (because left  mouse  button  or
  1956.          [Enter  has  been  pressed) then a case statement figures out
  1957.          what to do with the user's menu choice.
  1958.             If Mc is between 1 and 6, one of the procedures is called.
  1959.          Of  course,  these procedures can do anything you wish, based
  1960.          upon what menu item the user  has  selected.  The  last  Menu
  1961.          choice  (Sent[7])  is  'Quit'  and will cause this program to
  1962.          fall through and terminate.
  1963.             U  is  changed  into  an  uppercase  letter  so  that  the
  1964.          following  case  will work whether the user presses a capital
  1965.          or small letter. This second case checks to see  whether  the
  1966.          user  selected  a menu item based upon the capitalized letter
  1967.          hints.
  1968.              Assuming  the user did not select  'Quit'  or  press  #27
  1969.          (the [Escape] key)  or  the  right  mouse  button,  the  menu
  1970.          process will repeat.
  1971.              When  the  user  finally does choose to quit, the CleanUp
  1972.          procedure returns to DOS gracefully.
  1973.          *************************************************************
  1974.          MouseInstalled - Function
  1975.  
  1976.          Description:
  1977.          This boolean function returns true if a mouse and its  driver
  1978.          are installed.
  1979.  
  1980.          Considerations:
  1981.          The graphics mouse cursor works from keyboard  input  whether
  1982.          or not a mouse is installed.
  1983.  
  1984.          See Also: Poll, SetMouseRows, SetMouseColumns
  1985.  
  1986.          Example:
  1987.          program test;
  1988.          uses graph, magic;
  1989.          begin
  1990.             if MouseInstalled = false then Sent[1] := 'Mouse not found'
  1991.             else Sent[1] := 'A mouse is present';
  1992.             Present.GetAnyKey(10,10);
  1993.          end.
  1994.  
  1995.          Performance of Example:
  1996.          If  there  is  no mouse then MouseInstalled will be false and
  1997.          'Mouse not found' will pop up; If there is a mouse,  then  'A
  1998.          mouse is present' will appear.
  1999.          *************************************************************
  2000.          MusicOn - Global Variable - boolean;
  2001.  
  2002.          Description:
  2003.          This  boolean variable controls whether the sound effects are
  2004.          allowed to play.  The  default  for  MusicOn  is  true.  When
  2005.          MusicOn is set to false, calls to Pink, Twinkle, SoundUp, and
  2006.          SoundDown will be ignored until it is again set to true.
  2007.  
  2008.          See Also:  Pink,  Twinkle,  SoundUp,  SoundDown,  SorrySound,
  2009.          Bugle.
  2010.  
  2011.          Example:
  2012.          program test;
  2013.          uses magic;
  2014.          begin
  2015.             Sent[1] := 'Do you want sound effects? (Y/N)';
  2016.             Present.GetYN(-1,-1);
  2017.             if U = 'Y' then MusicOn := true else MusicOn := false;
  2018.             twinkle;
  2019.          end.
  2020.  
  2021.          Performance of Example:
  2022.          The user will be asked to press 'Y' or 'N' for sound effects.
  2023.          If the user selects 'Y' then MusicOn will be true and Twinkle
  2024.          will  play.  If  the user selects 'N' then no twinkle will be
  2025.          heard.
  2026.          *************************************************************
  2027.          NameInFile - Procedure
  2028.  
  2029.          Description:
  2030.          Magic  provides a standard text file for the input procedures
  2031.          FileRead and FileReadLn.  The default disk filename for  this
  2032.          is  INPUT.  You can change it to any DOS-legal filename, with
  2033.          optional drive and path  designation  up  to  60  characters.
  2034.          NameInFile  does  this  for  you  whether  or not the file is
  2035.          currently open.
  2036.  
  2037.          Considerations:
  2038.          If file is open, it will be reset after renaming.
  2039.  
  2040.          See Also:
  2041.          FileRead, FileReadLn
  2042.  
  2043.          Example:
  2044.          program test;
  2045.          uses crt,magic;
  2046.          begin
  2047.             NameInFile('MAGIC.DOC');
  2048.             repeat
  2049.                Sent[1] := FileReadLn;
  2050.                writeln(Sent[1]);
  2051.                delay(500);
  2052.             until Problem > 0;
  2053.          end.
  2054.          *************************************************************
  2055.          NameOutFile - Procedure
  2056.  
  2057.          Description:
  2058.          Magic provides a standard text file for the output procedures
  2059.          FileWrite,  FileWriteLn,  FileEcho,  and   FileEchoLn.    The
  2060.          default  disk filename for this is OUTPUT.  You can change it
  2061.          to any DOS-legal  filename,  with  optional  drive  and  path
  2062.          designation  up  to  60 characters. NameOutFile does this for
  2063.          you whether or not the file is currently open.
  2064.  
  2065.          Considerations:
  2066.          If file is open, it will be reset after renaming.
  2067.  
  2068.          See Also:
  2069.          FileWrite, FileWriteLn, FileEcho, FileEchoLn, NameInFile.
  2070.  
  2071.          Example:
  2072.          program test;
  2073.          uses crt,magic;
  2074.          begin
  2075.             NameOutFile('TEST.TXT');
  2076.             Pile('This is a test');
  2077.             FileWriteLn(Sent[1]);
  2078.          end.
  2079.          *************************************************************
  2080.          NText - Procedure
  2081.  
  2082.          Description:
  2083.          This procedure is quite similar to OutTextXY,  but  it  works
  2084.          with  only  one font, the standard text-mode font.  This font
  2085.          will be written using the background color variable  MainBack
  2086.          and the foreground variable MainText. It will place the upper
  2087.          left corner of the passed string at the passed coordinates.
  2088.  
  2089.          Considerations:
  2090.          This  font  is  available  only  in EGA-Hi, EGA-Lo and VGA-Hi
  2091.          graphics  modes  (VModes  4,3 and 6).  For some reason as yet
  2092.          undetermined, FloodFill fails to function  after  a  call  to
  2093.          NText.
  2094.  
  2095.          See Also:
  2096.          MainText, MainBack {Magic} OutTextXY, OutText {Borland}
  2097.  
  2098.          Example:
  2099.          program text;
  2100.          uses graphics,magic;
  2101.          begin
  2102.             VGAHiVideo;
  2103.             MainText := LightGray;
  2104.             MainBack := Black;
  2105.             NText(0,0,
  2106.                 'This looks like we''re not in a graphics mode!');
  2107.             WaitForUser;
  2108.          end.
  2109.          *************************************************************
  2110.          Number - Function
  2111.  
  2112.          Description:
  2113.             This function takes  the  global string variable, Answer,
  2114.          and returns  its  contents  as an integer variable. If there
  2115.          is any  problem,  Problem  (global boolean variable) becomes
  2116.          true and Number will be 0.
  2117.             This is particularly useful after a call to Dialog, which
  2118.          assigns a string to the global string, Answer.
  2119.  
  2120.          Considerations:
  2121.             Must be within the range of an integer as defined by Turbo
  2122.          Pascal.
  2123.  
  2124.          See Also:
  2125.             Dialog, Answer.
  2126.  
  2127.          Example:
  2128.          program test;
  2129.          begin
  2130.             Sent[1] := 'How many do you want?';
  2131.             Present.Dialog(-1,-1);
  2132.             if Number < 40 then do_something else do_different_thing;
  2133.          end.
  2134.  
  2135.          Performance of example:
  2136.             The user is presented with a question to which the answer
  2137.          is typed in the dialog  box.   Number  converts  the  Answer
  2138.          to an integer. In this sample program, if the user  typed  a
  2139.          number  less  than  40   then   the   fictitious   procedure
  2140.          do_something  is  executed,  otherwise do_different_thing is
  2141.          executed.
  2142.          *************************************************************
  2143.          OpenInFile - Procedure
  2144.  
  2145.          Description:
  2146.          This   procedure  tries  to  open  InFile  for  reading.   If
  2147.          successful,  the  global byte variable Problem = 0.  If it is
  2148.          not  possible  to open the file for reading then Problem will
  2149.          be greater than 0.  This is a useful way  to  check  for  the
  2150.          existence  of a file, and to reset a file to start reading at
  2151.          it's beginning.
  2152.  
  2153.          Considerations:
  2154.          This procedure is  automatically  called  from  FileRead  and
  2155.          FileReadLn.
  2156.  
  2157.          See Also:
  2158.          FileRead, FileReadLn.
  2159.          *************************************************************
  2160.          OutFile - Global Variable - file of text
  2161.  
  2162.          Description:
  2163.             OutFile is declared globally as a file of type Text. It is
  2164.          used for sending text information from your program  to  disk
  2165.          using   the   automatic  procedures  FileWrite,  FileWriteLn,
  2166.          FileEcho, and FileEchoLn.
  2167.  
  2168.          Considerations:
  2169.             OutFile  is  for  text  only.   Numeric  values  must   be
  2170.          represented  as  strings  for  OutFile.  You can override the
  2171.          automatic  use  of  OutFile  with   standard   Turbo   Pascal
  2172.          techniques  such  as  Assign,  ReWrite  and  Close. All Magic
  2173.          procedures which write to OutFile will automatically close it
  2174.          between uses, to insure against lost data in  case  of  power
  2175.          failure, crash, etc.
  2176.             The  default  filename  for  OutFile  is OUTPUT.  This can
  2177.          be changed with the procedure NameOutFile.
  2178.  
  2179.          See Also:
  2180.          InFile,   FileWrite,   FileWriteLn,   FileEcho,   FileEchoLn,
  2181.          NameInFile,  NameOutFile,  {Magic};  Assign,  ReWrite, ReSet,
  2182.          Append, Write, WriteLn, Read, ReadLn,  Rename,  Erase,  Close
  2183.          {Borland}
  2184.  
  2185.          Example:
  2186.          Program Test;
  2187.          uses magic;
  2188.          begin
  2189.             NameOutFile('TestFile.Txt');
  2190.             rewrite(OutFile);
  2191.             writeln(OutFile,'This is the only string in the file.');
  2192.             close(OutFile);
  2193.          end.
  2194.  
  2195.          Performance of example:
  2196.              The text file  called  OutFile  within  your  program  is
  2197.          associated  with  'TestFile.Txt'  on  disk. Whether or not it
  2198.          exists, it will be recreated as an empty file  with  ReWrite.
  2199.          Then one line is written to the file and it is closed. If you
  2200.          were to investigate TestFile.Txt with a  word  processor  you
  2201.          would find only one line of text: "This is the only string in
  2202.          the file."
  2203.          *************************************************************
  2204.          OutFileName - Global Variable - string[60]
  2205.  
  2206.          Description:
  2207.          OutFileName  is  a  string  to  hold the disk filename for the
  2208.          predeclared text file, OutFile.
  2209.  
  2210.          See Also:
  2211.          NameInFile,  NameOutFile,  FileWrite,  FileWritLn,  FileEcho,
  2212.          FileEchoLn.
  2213.  
  2214.          Example:
  2215.          program test;
  2216.          uses magic;
  2217.          begin
  2218.             Pile('Type name of disk file:');
  2219.             Present.Dialog(-1,-1);
  2220.             NameOutFile(Answer);
  2221.             FileWriteLn('This is a test.');
  2222.          end.
  2223.          *************************************************************
  2224.          Pink - Procedure
  2225.  
  2226.          Description:
  2227.             Pink  makes  a  sound  typically indicating a key has been
  2228.          pressed or a small action has occurred.
  2229.  
  2230.          Considerations:
  2231.             The boolean Variable MusicOn must be true or Pink will not
  2232.          make a sound. The default status of MusicOn is  true.  It  is
  2233.          possible   that   this   will   not  work  as  expected  when
  2234.          multitasking under DeskView or MS-Windows.
  2235.  
  2236.             Make sure to read the special note under MusicOn.
  2237.  
  2238.          See Also:
  2239.          MusicOn, Twinkle, Bird, SoundUp, SoundDown, SorrySound, Bugle
  2240.          {Magic} Sound, NoSound, Delay {Borland}
  2241.  
  2242.          Example:
  2243.          Program Test;
  2244.          uses crt,magic;
  2245.          begin
  2246.             XClear;
  2247.             repeat
  2248.                U := readkey;
  2249.                Pink;
  2250.                write(U);
  2251.             until (U = #27) or (U = #13); {Escape or Enter key}
  2252.          end.
  2253.  
  2254.          Performance of example:
  2255.              The screen will clear. Then every time a key is  pressed,
  2256.          it's  character  will  be  shown on the screen and an audible
  2257.          click  will  be  heard  until the user presses #27, the [Esc]
  2258.          key.  Crt  must  be  in  the  Uses  line because Readkey is a
  2259.          procedure within the Crt unit (Turbo.tpl).
  2260.          *************************************************************
  2261.          Pile - Procedure
  2262.  
  2263.          Description:
  2264.          Pile   adds  the  passed  string  to  the  array  Sent[]  and
  2265.          increments HowMany.
  2266.  
  2267.          Considerations:
  2268.          Pile can be used effectively at the beginning of  a  program,
  2269.          after  any call to GetAnyKey, GetYn, Dialog or Menu, or after
  2270.          ClearSents.   Otherwise,  it  may  be  confused  about  which
  2271.          Sent[] to update.
  2272.  
  2273.          See Also:
  2274.          Sent, GetYN, GetAnyKey, Dialog, Menu, Present, HowMany.
  2275.  
  2276.          Example:
  2277.          program test;
  2278.          uses magic;
  2279.          begin
  2280.              Pile('This is the first line');
  2281.              Pile('This is the second line');
  2282.              Present.GetAnyKey(-1,-1);
  2283.          end.
  2284.          *************************************************************
  2285.          PointerOff - Procedure
  2286.  
  2287.          Description:
  2288.             Turns off the mouse pointer or arrow.
  2289.  
  2290.          Considerations:
  2291.              See PointerOn.
  2292.  
  2293.          See Also:
  2294.          Poll, PointerOn, ResetMouse
  2295.  
  2296.          Example:
  2297.          Program Test;
  2298.          uses crt, graph, magic;
  2299.          var
  2300.            x,y : word;
  2301.          begin
  2302.             x := 0; y := 0;
  2303.             BestVideo;
  2304.             PointerOff;
  2305.             repeat
  2306.                Poll;
  2307.                lineto(Px,Py);
  2308.                x := x;
  2309.                y := y;
  2310.             until Left;
  2311.             PointerOn;
  2312.             PointerToXY;
  2313.             Waste;
  2314.             repeat Poll;
  2315.               until (keypressed) or (Left) or (Right);
  2316.             CleanUp;
  2317.          end.
  2318.  
  2319.          Performance of example:
  2320.             The  program will switch to a graphics mode and there will
  2321.          be no mouse pointer.  As long as the user moves the mouse,  a
  2322.          trail  of  lines  will  appear  on  the screen. When the user
  2323.          clicks the left mouse button, the mouse pointer will reappear
  2324.          and the drawing of lines will cease. When  the  user  presses
  2325.          any key or mouse button the program will terminate gracefully.
  2326.          Crt  must  be  in  the  Uses   line  because  Keypressed is a
  2327.          procedure within the Crt unit (Turbo.tpl).
  2328.          *************************************************************
  2329.          PointerOn - Procedure
  2330.  
  2331.          Description:
  2332.             Turns on the mouse pointer or arrow.
  2333.  
  2334.          Considerations:
  2335.          You might also want to call PointerToXY to  reset  the  mouse
  2336.          position to the current position, before calling PointerOn.
  2337.  
  2338.          See Also:
  2339.          Poll, PointerOff, ResetMouse, PointerToXY;
  2340.  
  2341.          Example:
  2342.          Program Test;
  2343.          uses crt, graph, magic;
  2344.          begin
  2345.             BestVideo;
  2346.             PointerOff;
  2347.             repeat
  2348.                Poll;
  2349.                lineto(Px,Py);
  2350.             until Left;
  2351.             PointerToXY;
  2352.             PointerOn;
  2353.             Waste;
  2354.             repeat Poll;
  2355.               until keypressed or Left or Right;
  2356.             CleanUp;
  2357.          end.
  2358.  
  2359.          Performance of example:
  2360.             The  program will switch to a graphics mode and there will
  2361.          be no mouse pointer.  As long as the user moves the mouse,  a
  2362.          trail  of  lines  will  appear  on  the screen. When the user
  2363.          clicks the left mouse button, the mouse pointer will reappear
  2364.          and the drawing of lines will cease. When  the  user  presses
  2365.          any key or mouse button the program will terminate gracefully.
  2366.          Crt must  be  in  the  Uses  line  because  Keypressed  is  a
  2367.          procedure within the Crt unit (Turbo.tpl).
  2368.          *************************************************************
  2369.          PointerToXY - Procedure
  2370.  
  2371.          Description:
  2372.             Moves  the  mouse pointer to coordinates Px and Py. Px and
  2373.          Py are global integer variables.
  2374.  
  2375.          Considerations:
  2376.             If  the  pointer  is  turned  off  (PointerOff)  then  the
  2377.          (graphics) CP (Current Position) will be moved to Px and Py.
  2378.  
  2379.          See Also:
  2380.          Poll,  PointerOff,   Pointeron,   ResetMouse,   SetMouseRows,
  2381.          SetMouseColumns.
  2382.  
  2383.          Example:
  2384.          Program Test;
  2385.          uses crt, graph, magic;
  2386.          begin
  2387.             BestVideo;
  2388.             Px := getmaxx div 2; Py := getmaxy div 2;
  2389.             PointerToXY;
  2390.             PointerOn;
  2391.             repeat until keypressed;
  2392.             CleanUp;
  2393.          end.
  2394.  
  2395.          Performance of example:
  2396.             The  current  position  is  moved to Px and Py, which have
  2397.          been assigned the center of  the  screen.  The  pointer  will
  2398.          appear  there.   The  program  waits  for the user to press a
  2399.          key, then terminates gracefully.  Crt must  be  in  the  Uses
  2400.          line  because  Keypressed  is a procedure within the Crt unit
  2401.          (Turbo.tpl).
  2402.          *************************************************************
  2403.          PointerStatus - Global Variable - boolean
  2404.  
  2405.          Description:
  2406.          The global boolean variable PointerStatus is  true  when  the
  2407.          graphics "mouse" cursor is visible.   It  is  used  by  Magic
  2408.          procedures draw cursor.
  2409.  
  2410.          Considerations:   Direct manipulation of this variable is not
  2411.          recommended.
  2412.  
  2413.          See Also:
  2414.          PointerToXY, Poll, PointerOn, PointerOff, ResetMouse
  2415.          *************************************************************
  2416.          Poll - Procedure
  2417.  
  2418.          Description:
  2419.          Poll  updates  the  global boolean variables Left, Center and
  2420.          Right and the global integer variables  Px,  and  Py.   Left,
  2421.          Center and Right are true if a mouse button is pressed during
  2422.          Poll.  Center is always false with two-button mice or when no
  2423.          mouse  is  installed.   Px and py are global integers used to
  2424.          represent the x and y graphics cursor position.
  2425.             Poll works whether  or  not  a  mouse  is  installed,  and
  2426.          whether or not the cursor is visible. Besides accepting input
  2427.          from the mouse: if [Enter] is pressed, Left becomes true.  If
  2428.          [Esc]  is  pressed,  Right  becomes true.  If the arrow keys,
  2429.          [Page Up], [Page Down], [Home], [End] or the number keys  are
  2430.          pressed,  the  graphics  cursor will be moved.  Some of these
  2431.          keys cause fine movements while others cause gross  movement.
  2432.          Some are diagonal and some are perpendicular.
  2433.  
  2434.          See Also:
  2435.          PointerToXY,  SetMouseRows,  SetMouseColumns,  Left,  Center,
  2436.          Right, Px, Py.
  2437.  
  2438.          Example:
  2439.          Program Test;
  2440.          uses crt, graph, magic;
  2441.          begin
  2442.             BestVideo;
  2443.             PointerOff;
  2444.             repeat
  2445.                Poll;
  2446.                lineto(Px,Py);
  2447.             until Left;
  2448.          end.
  2449.          *************************************************************
  2450.          Present - Instance of object Presento
  2451.  
  2452.          Present  is an instance of the object, Presento, pre-declared
  2453.          in  the  Magic  Unit.   You can use Present and it's  methods
  2454.          without knowledge of OOP.  Examples:
  2455.  
  2456.          Present.Init(x,y)  {places text in a box on screen}
  2457.          Present.GetYN(x,y) {presents text box, waits for user to press
  2458.                             [Y] or [N]}
  2459.          Present.GetAnyKey(x,y) {Presents text box, waits for keypress}
  2460.          Present.Menu(x,y,'abcd') {Presents menu, waits for selection}
  2461.          Present.Dialog(x,y) {Presents text box, waits for answer}
  2462.  
  2463.          Considerations:
  2464.          The  array, Sent[], and the variables HowMany and HowLong are
  2465.          external of the object and are reused from  one  instance  to
  2466.          another.
  2467.              Other  instances  of  the Presento object can be declared
  2468.          within procedures for limited lifespan,  and  duplication  of
  2469.          task, as in the following example:
  2470.  
  2471.          procedure xxx;
  2472.          var Present2 : Presento;
  2473.          begin
  2474.             .
  2475.             .
  2476.             Present.Init;
  2477.             .
  2478.             .
  2479.             Present2.Menu;
  2480.             .
  2481.             .
  2482.             Present2.Init;
  2483.             .
  2484.             .
  2485.             Present2.Done;
  2486.             .
  2487.             .
  2488.             Present.Done;
  2489.             .
  2490.             .
  2491.          end;
  2492.  
  2493.          See   Also:  Init,  GetYN,  GetAnyKey,  Dialog,  Menu,  Sent,
  2494.          HowMany, HowLong, FigureHowMany, FigureHowLong.
  2495.          *************************************************************
  2496.          Problem - Global Variable - byte
  2497.  
  2498.          Description:
  2499.             Problem is a global byte variable that is usually set to 0
  2500.          as any graphics or i/o procedure in the  Magic  unit  starts.
  2501.          Then,  if  a  problem  occurs,  the procedure will handle the
  2502.          problem as cleanly as possible and set Problem to true.
  2503.  
  2504.             For instance, if FileWrite is asked to write a string to a
  2505.          write-protected disk, the program will not  crash,  but  will
  2506.          not write to the disk, and Problem becomes true. You can then
  2507.          test  Problem  and  branch  in  your  program  to  handle the
  2508.          'problem.'
  2509.  
  2510.          Considerations:
  2511.              Problem must be  checked  before  a  call  to  any  other
  2512.          procedure  in  the Magic unit because the next procedure will
  2513.          reset Problem to 0 as it starts.
  2514.  
  2515.          Example:
  2516.          Program Test;
  2517.          uses magic;
  2518.          begin
  2519.            NameOutFile('testfile.txt');
  2520.            FileWriteLn('This is a line of nonsense.');
  2521.            if Problem  > 0 {= true} then
  2522.            begin
  2523.              Sent[1] := 'Problem writing to disk';
  2524.              Sent[2] := 'Disk may be full or write-protected';
  2525.              Sent[3] := 'Press any key to continue..';
  2526.              Present.GetAnyKey(-1,-1);
  2527.            end;
  2528.            .
  2529.            .
  2530.          end.
  2531.  
  2532.          Performance of example:
  2533.             This program tries to write, "This is a line of  nonsense"
  2534.          to   a  disk  file  called  "Testfile.txt."  If  this  proves
  2535.          impossible, then Problem is greater than 0 and  a  three-line
  2536.          notice pops up on the screen.
  2537.          *************************************************************
  2538.          Px, Py - Global Variables - Integers
  2539.  
  2540.          Description:
  2541.          Px and Py  are  global  variables  defined  in  magic.tpu  as
  2542.          integers.  The  most  common  use  of  Px  is  to designate a
  2543.          horizontal screen position, and Py is used to  designate  the
  2544.          vertical coordinate.
  2545.  
  2546.          Considerations:
  2547.          Each call to Poll will reset Px and Py.
  2548.  
  2549.          See Also:
  2550.          Poll, PointerToXy, SetMouseRows, SetMouseColumns
  2551.          *************************************************************
  2552.          PutPCX - Procedure
  2553.  
  2554.          Description:
  2555.          PutPCX  requires  two  passed  parameters, the name of a .PCX
  2556.          file and a boolean.  PutPCX  will  then  attempt  to  display
  2557.          that  file  on  screen,  overwriting  whatever  is  currently
  2558.          displayed. If successful, Problem is set to 0.  If unable  to
  2559.          display the .PCX file, Problem will (usually) be greater than
  2560.          0.
  2561.             The boolean varialble determines whether the color palette
  2562.          is to be reset to the color information contained within  the
  2563.          .PCX  file.  Generally you would use TRUE, but there are some
  2564.          .PCX files  (especially  scanned  photos),  which  reset  the
  2565.          colors to values not useable by the rest of your program. For
  2566.          instance,  your  mouse arrow or on-screen menus may disappear
  2567.          if reset to the .PCX file's colors.
  2568.  
  2569.          Considerations:
  2570.          There is a global byte variable called ForceMode which can be
  2571.          used to control the power of PutPCX.  The default  value  for
  2572.          ForceMode  is 0, which allows PutPCX to change the video mode
  2573.          to the correct one for the desired .PCX  picture.   In  other
  2574.          words,  with  ForceMode  set  to 0, if you pass to PutPCX the
  2575.          name of a .PCX file drawn  in  256-color  VGA-Lo  mode,  then
  2576.          VMode  7  (256-color  VGA-Lo)  will  be  selected and set up.
  2577.          Changing ForceMode to these values will have these effects:
  2578.  
  2579.          ForceMode   PutPCX Does
  2580.          =========   ================================================
  2581.              0       Reset video mode according to needs of .PCX file
  2582.              1       Reset video mode to CGA-Hi 640 x 200 2-color
  2583.              2       Reset video mode to CGA-Lo 320 x 200 4-color
  2584.              3       Reset video mode to EGA-Lo 640 x 200 16-color
  2585.              4       Reset video mode to EGA-Hi 640 x 350 16-color
  2586.              5       Reset video mode to Hercules 720 x 348 2-color
  2587.              6       Reset video mode to VGA-Hi 640 x 480 16-color
  2588.              7       Reset video mode to VGA-Lo 320 x 200 256-color
  2589.              8       Reset video mode to Super-VGA 640 x 480 256-color
  2590.             99       Does not reset video mode
  2591.  
  2592.              Be careful to avoid forcing mode inappropriately, thereby
  2593.          causing illegible picture or crash.
  2594.  
  2595.              Not  all  .PCX  pictures  can  be  displayed.   The  .PCX
  2596.          specifications are very flexible, and some  image  generators
  2597.          are just too weird.
  2598.  
  2599.              Older, version 2.0 .PCX files with an external  256-color
  2600.          palette  file  (*.PAL)  are handled automatically in the same
  2601.          manner as newer files with internal palette information.
  2602.  
  2603.          Example:
  2604.          program test;
  2605.          uses magic;
  2606.          begin
  2607.             PutPCX('Earth',true);
  2608.             WaitForUser;
  2609.          end.
  2610.          *************************************************************
  2611.          ResetMouse - Procedure
  2612.  
  2613.          Description:
  2614.             This   restores   the   mouse  situation  to  its  default
  2615.          parameters. In graphics modes  the  "mouse"  cursor  will  be
  2616.          relocated  to the center of the screen and the left and right
  2617.          mouse button status will be not pressed.  The cursor will not
  2618.          be visible.
  2619.  
  2620.          Considerations:
  2621.          ResetMouse is called automatically when  the  video  mode  is
  2622.          changed.
  2623.  
  2624.          See also:
  2625.          Poll, PointerToXY, PointerOn, PointerOff
  2626.          *************************************************************
  2627.          Restore - Object Method
  2628.  
  2629.          Description:
  2630.             Restore restores information about Viewport Settings, Line
  2631.          Style,  Text  Justification,  Text  Style,  Fill Settings and
  2632.          current color as they were previously captured by a  call  to
  2633.          Save.   This is useful before calls to Presento.Init or other
  2634.          procedures which may temporarily disrupt your  graphics  text
  2635.          settings.   When  done with the disruptive procedure, you can
  2636.          then call Restore to reset everything the way it was.
  2637.              GetYN,  GetAnyKey, Dialog, and Menu call Save and Restore
  2638.          automatically.
  2639.              Restore  is  a method of the Settingso object (from which
  2640.          Presento is descended) and can be called without knowledge of
  2641.          OOP  (Object  Oriented  Programming)  by  simply  using   the
  2642.          pre-declared settings instance as in the example below.
  2643.  
  2644.          Considerations:
  2645.          Has no effect in text mode.
  2646.  
  2647.          See Also;
  2648.          Settings, Save, Init
  2649.  
  2650.          Example:
  2651.          program test;
  2652.          uses graph,magic;
  2653.          begin
  2654.             Settings.Save;
  2655.             SetTextStyle(1,0,4);
  2656.             SetColor(LightGreen);
  2657.             SetLineStyle(0,0,3);
  2658.             .
  2659.             .
  2660.             Settings.Restore;
  2661.             OutTextXY(0,0,'Everything is back to normal');
  2662.             .
  2663.             .
  2664.          end;
  2665.          *************************************************************
  2666.          Right - Global Variable
  2667.  
  2668.          Description:
  2669.             Right  is  a  global  boolean  variable used to record the
  2670.          status of the left mouse button.  If Right =  true  then  the
  2671.          right mouse button has been pressed.
  2672.  
  2673.          Considerations:
  2674.             The  status  of Right will change with every call to Poll,
  2675.          Waste, ResetMouse or procedures  within  Magic  which  handle
  2676.          text or pop-up boxes.
  2677.  
  2678.          See Also: Poll, Waste, ResetMouse, left, Center.
  2679.  
  2680.          Example:
  2681.          Program Test;
  2682.          uses magic;
  2683.          begin
  2684.             Sent[1] := 'Nothing will change until you click the';
  2685.             Sent[2] := 'right mouse button';
  2686.             Present.Init(-1,-1);
  2687.             Waste;
  2688.             repeat Poll; until Right;
  2689.          end.
  2690.  
  2691.          Performance of example:
  2692.             A box containing two lines of text will stay on the screen
  2693.          until the user clicks the right mouse  button.   The  program
  2694.          will then terminate.
  2695.          *************************************************************
  2696.          Sansserif - Procedure
  2697.  
  2698.          Description:
  2699.              Calling  the procedure Sansserif makes the Sansserif font
  2700.          available  to  graphic-based  programs.  This  font  will  be
  2701.          compiled  into  the  .EXE  file.   SANS.CHR  does not have to
  2702.          accompany the finished product.
  2703.  
  2704.          Considerations:
  2705.          Compiled .EXE size increases by about 17k. Dimensions of  the
  2706.          Sansserif   font   can   be  changed  with  SetTextStyle  and
  2707.          SetUserCharSize.   Sansserif  is  font  #3  (for   use   with
  2708.          SetTextStyle).
  2709.  
  2710.          See Also:
  2711.          Gothic, BitMap, Triplex, Little, Bold, Simple, Lcom,  Italic,
  2712.          Script,   European   {Magic}   SetUserCharSize,  SetTextStyle
  2713.          {Borland}
  2714.  
  2715.          Example:
  2716.          Program Test;
  2717.          uses crt, graph, magic;
  2718.          begin
  2719.             BestVideo;
  2720.             Sansserif;
  2721.             OutTextXY(0,0,'Regular-size Sansserif');
  2722.             SetTextStyle(3,0,9);
  2723.             OutTextXY(100,100,'Huge');
  2724.             WaitForUser;
  2725.          end.
  2726.          *************************************************************
  2727.          Save - Object Method
  2728.  
  2729.          Description:
  2730.             Save captures information about  Viewport  Settings,  Line
  2731.          Style,  Text  Justification,  Text  Style,  Fill Settings and
  2732.          current color.  This is useful before calls to  Presento.Init
  2733.          or  other  procedures  which  may  temporarily  disrupt  your
  2734.          graphics  text  settings.   When  done  with  the  disruptive
  2735.          procedure,  you can then call Restore to reset everything the
  2736.          way it was.
  2737.              GetYN,  GetAnyKey, Dialog, and Menu call Save and Restore
  2738.          automatically.
  2739.              Save is a method of  the  Settingso  object  (from  which
  2740.          Presento is descended) and can be called without knowledge of
  2741.          OOP   (Object  Oriented  Programming)  by  simply  using  the
  2742.          pre-declared settings instance as in the example below.
  2743.  
  2744.          Considerations:
  2745.          Has no effect in text mode.
  2746.  
  2747.          See Also;
  2748.          Settings, Restore, Init
  2749.  
  2750.          Example:
  2751.          program test;
  2752.          uses graph,magic;
  2753.          begin
  2754.             Settings.Save;
  2755.             SetTextStyle(1,0,4);
  2756.             SetColor(LightGreen);
  2757.             SetLineStyle(0,0,3);
  2758.             .
  2759.             .
  2760.             Settings.Restore;
  2761.             OutTextXY(0,0,'Everything is back to normal');
  2762.             .
  2763.             .
  2764.          end;
  2765.          *************************************************************
  2766.          Script - Procedure
  2767.  
  2768.          Description:
  2769.              Calling  the  procedure  Script  makes  the  Script  font
  2770.          available to  graphic-based  programs.   This  font  will  be
  2771.          compiled into the .EXE file.
  2772.  
  2773.          Considerations:
  2774.          Compiled  .EXE size increases by about 17k. Dimensions of the
  2775.          Script  font   can   be   changed   with   SetTextStyle   and
  2776.          SetUserCharSize.    Script   is   font   #5   (for  use  with
  2777.          SetTextStyle).
  2778.  
  2779.          See Also:
  2780.          Bold, Lcom, Simple, Gothic, BitMap, Triplex, Little,  Italic,
  2781.          Sansserif,  European  {Magic}  SetUserCharSize,  SetTextStyle
  2782.          {Borland}
  2783.  
  2784.          Example:
  2785.          Program Test;
  2786.          uses crt, graph, magic;
  2787.          begin
  2788.             BestVideo;
  2789.             Script;
  2790.             OutTextXY(0,0,'Regular-size Script');
  2791.             SetTextStyle(5,0,9);
  2792.             OutTextXY(100,100,'Huge');
  2793.             WaitForUser;
  2794.          end.
  2795.          *************************************************************
  2796.          Sent - Global Variable - array
  2797.  
  2798.          Description:
  2799.          Sent  is  a  global  array  of 48 strings, each with up to 80
  2800.          characters.  Sent is used to  hold  strings  for  display  by
  2801.          Init, GetYN, GetAnyKey, Dialog and Menu.
  2802.  
  2803.          Considerations:
  2804.          Although there are  48  strings  available  in  Sent[],  most
  2805.          instances  of pop-up boxes cannot display that many on-screen
  2806.          at one time.
  2807.  
  2808.          See Also:
  2809.          Pile, Init, GetYN, GetAnyKey, Dialog, Menu, ClearSents
  2810.          *************************************************************
  2811.          SetMouseColumns - Procedure
  2812.  
  2813.          Description:
  2814.          SetMouseColumns  limits  the  horizontal  range  of the mouse
  2815.          cursor. This procedure requires 2 integers, representing  the
  2816.          maximum  horizontal  location  in which the mouse is allowed,
  2817.          followed by the mininum location.
  2818.  
  2819.          Considerations:
  2820.          Limits beyond the  range  of  the  current  video  mode  have
  2821.          unpredictable  results.   In  text mode, SetMouseColumns uses
  2822.          CGA-Hi resolution, 640 pixels (divided  by  8  for  character
  2823.          positions).
  2824.  
  2825.          See Also:
  2826.          ResetMouse, PointerToXY, PointerOn, PointerOff, SetMouseRows
  2827.  
  2828.          Example:
  2829.          Program Test;
  2830.          uses crt,magic;
  2831.          begin
  2832.             VGAHiVideo;
  2833.             SetMouseColumns(639,320);
  2834.             pointeron;
  2835.             repeat
  2836.                poll;
  2837.             until left;
  2838.             cleanup;
  2839.          end.
  2840.  
  2841.          Performance of example:
  2842.          Program  initializes  VGA high resolution mode, and the mouse
  2843.          arrow is visible.  The pointer's movement  is  restricted  to
  2844.          the  right  half  of the screen.  The pointer can be moved by
  2845.          the user (within the right side only) until  the  left  mouse
  2846.          button is pressed.
  2847.  
  2848.          *************************************************************
  2849.          SetMouseRows - Procedure
  2850.  
  2851.          Description:
  2852.          SetMouseRows  limits  the vertical range of the mouse cursor.
  2853.          This procedure requires 2 integers, representing the  maximum
  2854.          vertical  location in which the mouse is allowed, followed by
  2855.          the mininum location.
  2856.  
  2857.          Considerations:
  2858.          Limits beyond the  range  of  the  current  video  mode  have
  2859.          unpredictable  results.   In  text  mode,  SetMouseRows  uses
  2860.          CGA-Hi resolution, 200 pixels (divided  by  8  for  character
  2861.          positions).
  2862.  
  2863.          See Also:
  2864.          ResetMouse,     PointerToXY,      PointerOn,      PointerOff,
  2865.          SetMouseColumns
  2866.  
  2867.          Example:
  2868.          Program Test;
  2869.          uses crt,magic;
  2870.          begin
  2871.             VGAHiVideo;
  2872.             SetMouseRows(239,0);
  2873.             pointeron;
  2874.             repeat
  2875.                poll;
  2876.             until left;
  2877.             cleanup;
  2878.          end.
  2879.  
  2880.          Performance of example:
  2881.          Program  initializes  VGA high resolution mode, and the mouse
  2882.          arrow is visible.  The pointer's movement  is  restricted  to
  2883.          the  upper  half  of the screen.  The pointer can be moved by
  2884.          the user (within the top half  only)  until  the  left  mouse
  2885.          button is pressed.
  2886.  
  2887.          *************************************************************
  2888.          Settings - Object Instance of Settingso
  2889.  
  2890.          Description:
  2891.          Settingso is a simple object which simply saves and  restores
  2892.          an  assortment  of  settings  pertaining  to text in graphics
  2893.          modes.  Settings is an instance of Settingso pre-declared  in
  2894.          the Magic unit.
  2895.  
  2896.          See Also:
  2897.          Save, Restore
  2898.  
  2899.          Example:
  2900.          See Save
  2901.          *************************************************************
  2902.          SetVMode - Procedure
  2903.  
  2904.          Description:
  2905.          SetVMode will reset the video mode to the number:
  2906.  
  2907.            VMode  Action
  2908.            ====   ======
  2909.              0       Reset video mode to text video
  2910.              1       Reset video mode to CGA-Hi 640 x 200 2-color
  2911.              2       Reset video mode to CGA-Lo 320 x 200 4-color
  2912.              3       Reset video mode to EGA-Lo 640 x 200 16-color
  2913.              4       Reset video mode to EGA-Hi 640 x 350 16-color
  2914.              5       Reset video mode to Hercules 720 x 348 2-color
  2915.              6       Reset video mode to VGA-Hi 640 x 480 16-color
  2916.              7       Reset video mode to VGA-Lo 320 x 200 256-color
  2917.              8       Reset video mode to Super-VGA 640 x 480 256-color
  2918.          See Also:
  2919.          TextVideo,  BestVideo,  CGAHiVideo,  CGALoVideo,  EGAHiVideo,
  2920.          EGALoVideo,  HercVideo,  VGAHiVideo,  VGALoVideo,  SVGAVideo,
  2921.          VMode.
  2922.  
  2923.          Example:
  2924.          program test;
  2925.          uses magic,graph;
  2926.          begin
  2927.             SetVMode(2);
  2928.             line(0,0,319,199);
  2929.             WaitForUser;
  2930.          end.
  2931.          *************************************************************
  2932.          Shadow - Global Variable - byte
  2933.  
  2934.          Description:
  2935.          This sets the color of shadows at the bottom and  right  edge
  2936.          of  pop-up  text boxes, where 'color' is an integer from 0 to
  2937.          15 or a color  constant  as  defined  by  Borland.  Works  in
  2938.          graphics and text mode.
  2939.  
  2940.          Considerations:
  2941.          May  not  have the expected effect when used with the limited
  2942.          palettes of 4-color CGA (mode  0,1  or  2),  2-color  CGA  or
  2943.          Hercules. In text mode, only 8 colors  are  available: 0 - 7,
  2944.          for correct operation (hiding of the cursor).
  2945.  
  2946.          See  also:  MainText,  MainBack,  BoxText,  BoxBack, BarText,
  2947.          BarBack, Border.
  2948.  
  2949.          Example:
  2950.          program test;
  2951.          uses magic;
  2952.          begin
  2953.             Sent[1] := 'First Thing';
  2954.             Sent[2] := 'Second Thing';
  2955.             Sent[3] := 'Quit';
  2956.             Mc := 1;
  2957.             Shadow := Cyan;
  2958.             Present.Menu(-1,-1);
  2959.             .
  2960.             .
  2961.          end.
  2962.  
  2963.          Performance of example:
  2964.             A menu pops up with a LightCyan shadow.
  2965.          *************************************************************
  2966.          Simple - Procedure
  2967.  
  2968.          Description:
  2969.              Calling the procedure Simple  makes  the  Borland  Simple
  2970.          font  available to graphic-based programs.  This font will be
  2971.          compiled into the .EXE  file.   Simp.CHR  does  not  have  to
  2972.          accompany the finished product.
  2973.  
  2974.          Considerations:
  2975.          Compiled  .EXE size increases by about 17k. Dimensions of the
  2976.          Simple  font   can   be   changed   with   SetTextStyle   and
  2977.          SetUserCharSize.    Simple   is   font   #6   (for  use  with
  2978.          SetTextStyle).
  2979.  
  2980.          See Also:
  2981.          SansSerif, BitMap, Triplex, Little, Italic, Script, European,
  2982.          Gothic,  Bold,  Lcom  {Magic}  SetUserCharSize,  SetTextStyle
  2983.          {Borland}
  2984.  
  2985.          Example:
  2986.          Program Test;
  2987.          uses crt, graph, magic;
  2988.          begin
  2989.             BestVideo;
  2990.             Simple;
  2991.             OutTextXY(0,0,'Regular-size Simple');
  2992.             SetTextStyle(6,0,9);
  2993.             OutTextXY(100,100,'Huge');
  2994.             WaitForUser;
  2995.          end.
  2996.          *************************************************************
  2997.          SorrySound - Procedure
  2998.  
  2999.          Description:
  3000.          A sound effect.
  3001.  
  3002.          Considerations:
  3003.             The  global  boolean  Variable  MusicOn  must  be  true or
  3004.          SorrySound will not make a  sound.   The  default  status  of
  3005.          MusicOn  is  true.  It is possible that this will not work as
  3006.          expected when multitasking under DeskView or MS-Windows.
  3007.  
  3008.             Make sure to read the special note under MusicOn.
  3009.  
  3010.          See Also:
  3011.          MusicOn,  Twinkle,  SoundUp,  Pink,  Bugle   {Magic}   Sound,
  3012.          NoSound, Delay {Borland}
  3013.  
  3014.          Example:
  3015.          Program Test;
  3016.          uses magic;
  3017.          begin
  3018.            SorrySound;
  3019.          end.
  3020.          *************************************************************
  3021.          SoundDown - Procedure
  3022.  
  3023.          Description:
  3024.             SoundDown  makes   a  sound  typically indicating a window
  3025.          is being closed or a large action has occurred.
  3026.  
  3027.          Considerations:
  3028.             The  global  boolean  Variable  MusicOn  must  be  true or
  3029.          SoundDown will not  make  a  sound.  The  default  status  of
  3030.          MusicOn  is  true.  It is possible that this will not work as
  3031.          expected when multitasking under DeskView or MS-Windows.
  3032.  
  3033.             Make sure to read the special note under MusicOn.
  3034.  
  3035.          See Also:
  3036.          MusicOn, Twinkle, SoundUp, Pink,  Bugle,  SorrySound  {Magic}
  3037.          Sound, NoSound, Delay {Borland}
  3038.  
  3039.          Example:
  3040.          Program Test;
  3041.          uses magic;
  3042.          begin
  3043.             SoundDown;
  3044.          end.
  3045.          *************************************************************
  3046.          SoundUp - Procedure
  3047.  
  3048.          Description:
  3049.             SoundUp  makes  a  sound  typically indicating a window is
  3050.          being opened or a large action has occurred.
  3051.  
  3052.          Considerations:
  3053.             The global  boolean  Variable  MusicOn  must  be  true  or
  3054.          SoundUp  will not make a sound. The default status of MusicOn
  3055.          is true. It is possible that this will not work  as  expected
  3056.          when multitasking under DeskView or MS-Windows.
  3057.  
  3058.             Make sure to read the special note under MusicOn.
  3059.  
  3060.          See Also:
  3061.          MusicOn,  Twinkle, SoundDown, Pink, Bugle, SorrySound {Magic}
  3062.          Sound, NoSound, Delay {Borland}
  3063.  
  3064.          Example:
  3065.          Program Test;
  3066.          uses magic;
  3067.          begin
  3068.             SoundDown;
  3069.          end.
  3070.          *************************************************************
  3071.          SVGAVideo - Procedure
  3072.  
  3073.          Description:
  3074.          This initializes the system in Super-VGA 640 x 480  256-color
  3075.          graphics mode.  Super-VGA video driver will be  automatically
  3076.          compiled into the .EXE program file, eliminating the need for
  3077.          an external 256-color .BGI file.
  3078.  
  3079.          Considerations:
  3080.             There  are  several   other   graphmodes   available   for
  3081.          Super-VGA. The default graph mode is 2, but can be set from 0
  3082.          to 4.  0 = 320 x 200 256-color, and 4 = 1024 x 768 256-color.
  3083.          These  other graphics modes are not supported by Pascal Magic
  3084.          routines.  Borland's ImageSize function may not work properly
  3085.          with the other graph modes.  To reset to another  graph  mode
  3086.          follow this exmaple which results in 1024 x 768 256-color:
  3087.  
  3088.             SVGAVideo;
  3089.             SetGraphMode(4);
  3090.  
  3091.          See Also:
  3092.          BestVideo,  HercVideo,  CGAHiVideo,  CGALoVideo,  EGAHiVideo,
  3093.          EGALoVideo,  VGAHiVideo,  VGALoVideo  {Magic};  SetGraphMode,
  3094.          Setcolor, etc. {Borland}
  3095.  
  3096.          Example:
  3097.          Program Test;
  3098.          uses graph, magic;
  3099.          begin
  3100.             SVGAVideo;
  3101.             setcolor(53);
  3102.             rectangle(10,10,20,20);
  3103.             WaitForUser;
  3104.             CleanUp;
  3105.          end.
  3106.  
  3107.          Performance of example:
  3108.          The  system  is  put  in  VGA low-resolution graphics mode. A
  3109.          small light-blue rectangle is displayed  in  the  upper  left
  3110.          corner  of  the screen until any key is pressed.  The program
  3111.          then terminates gracefully.  Crt must be  in  the  Uses  line
  3112.          because  Keypressed  is  a  procedure  within  the  Crt  unit
  3113.          (Turbo.tpl).
  3114.  
  3115.          *************************************************************
  3116.          TextVideo - Procedure
  3117.  
  3118.          Description:
  3119.              This returns a program from a graphics video mode to text
  3120.          mode, the default startup condition. The screen is cleared.
  3121.  
  3122.          Considerations:
  3123.              Any memory held for a saved screen from a pop-up box will
  3124.          be released.
  3125.  
  3126.          See Also:
  3127.          BestVideo,  CGAHiVideo,  CGALoVideo,  HercVideo,  EGAHiVideo,
  3128.          EGALoVideo, VGAHiVideo, VGALoVideo, SVGAVideo
  3129.  
  3130.          Example:
  3131.          Program Test;
  3132.          uses graph, magic;
  3133.          begin
  3134.             BestVideo;
  3135.             Sent[1] := 'This is graphics mode';
  3136.             Sent[2] := 'Press any key to see text mode';
  3137.             Present.GetAnyKey(-1,-1);
  3138.             TextVideo;
  3139.             Sent[1] := 'This is text mode';
  3140.             Sent[2] := 'Press any key to quit';
  3141.             Present.GetAnyKey(-1,-1);
  3142.          end.
  3143.  
  3144.          Performance of example:
  3145.             A  box  pops up in the best graphics mode the computer can
  3146.          display. When the user presses a key, the  computer  switches
  3147.          to  text  video  mode  and another box appears until the user
  3148.          presses a key again.
  3149.          *************************************************************
  3150.          Triplex - Procedure
  3151.  
  3152.          Description:
  3153.              Calling the procedure Triplex makes the  Borland  Triplex
  3154.          font  available  to graphic-based programs. This font will be
  3155.          compiled into the .EXE  file.   TRIP.CHR  does  not  have  to
  3156.          accompany the finished product.
  3157.  
  3158.          Considerations:
  3159.          Compiled  .EXE size increases by about 17k. Dimensions of the
  3160.          Triplex  font  can   be   changed   with   SetTextStyle   and
  3161.          SetUserCharSize.    Triplex   is   font   #1  (for  use  with
  3162.          SetTextStyle).
  3163.  
  3164.          See Also:
  3165.          BitMap,  SansSerif,  Gothic,  Little,  Bold,  Simple,   Lcom,
  3166.          Italic,    Script,    European    {Magic}    SetUserCharSize,
  3167.          SetTextStyle {Borland}
  3168.  
  3169.          Example:
  3170.          Program Test;
  3171.          uses crt, graph, magic;
  3172.          begin
  3173.             BestVideo;
  3174.             Triplex;
  3175.             OutTextXY(0,0,'Regular-size Triplex');
  3176.             SetTextStyle(1,0,9);
  3177.             OutTextXY(100,100,'Huge');
  3178.             WaitForUser;
  3179.          end.
  3180.          *************************************************************
  3181.          Twinkle - Procedure
  3182.  
  3183.          Description:
  3184.             Twinkle makes  a  sound  typically indicating an action
  3185.          has positively been completed.
  3186.  
  3187.          Considerations:
  3188.          The  global  boolean Variable MusicOn must be true or Twinkle
  3189.          will not make a sound.  The  default  status  of  MusicOn  is
  3190.          true. It is possible that this will not work as expected when
  3191.          multitasking under DeskView or MS-Windows.
  3192.  
  3193.             Make sure to read the special note under MusicOn.
  3194.  
  3195.          See Also:
  3196.          MusicOn, SoundUp, SoundDown, Bird,  Pink,  Bugle,  SorrySound
  3197.          {Magic} Sound, NoSound, Delay {Borland}
  3198.  
  3199.          Example:
  3200.          Program Test;
  3201.          uses magic;
  3202.          begin
  3203.             Twinkle;
  3204.          end.
  3205.          *************************************************************
  3206.          U - Global Variable - char
  3207.  
  3208.          Description:
  3209.             U is a general purpose global char  variable  declared  in
  3210.          the  Magic  unit  for internal use, but available for any use
  3211.          within your program.  U originally stood for UserInput.
  3212.  
  3213.          Considerations:
  3214.             U  is  reset by several of the functions and procedures in
  3215.          the Magic Unit.  Do not assume the value of U will remain the
  3216.          same after use of procedures such as Dialog, XReadKey, etc.
  3217.  
  3218.          Example:
  3219.          Program Test;
  3220.          uses magic;
  3221.          begin
  3222.             Answer := '';
  3223.             repeat
  3224.                U := upcase(readkey);
  3225.                if ord(U) > 31 then
  3226.                begin
  3227.                   Answer := Answer + U;
  3228.                   write(U);
  3229.                end;
  3230.             until (U = #27) or (U = #13);
  3231.             .
  3232.             .
  3233.          end.
  3234.  
  3235.          Performance of example:
  3236.             This program is a very stripped down way to get input from
  3237.          the keyboard and change it in to an all uppercase string.
  3238.          *************************************************************
  3239.          VGAHiVideo - Procedure
  3240.  
  3241.          Description:
  3242.          This initializes the system in VGA high-resolution 640 x  480
  3243.          16-color   graphics   mode.   VGA   video   driver   will  be
  3244.          automatically  compiled   into   the   .EXE   program   file,
  3245.          eliminating the need for external EGAVGA.BGI file.
  3246.  
  3247.          Considerations:
  3248.              The resulting .EXE file is much smaller than one compiled
  3249.          after a call to BestVideo.   BestVideo  builds  all  graphics
  3250.          drivers into the .EXE file, but VGAHiVideo builds in only the
  3251.          EGAVGA  driver.   Video.Tpu  must  be  available  until after
  3252.          compilation.
  3253.              There  are  several graphmodes available for VGA. See the
  3254.          Borland manuals.
  3255.  
  3256.          See Also:
  3257.          BestVideo,  HercVideo,  CGAHiVideo,  CGALoVideo,  EGAHiVideo,
  3258.          EGALoVideo,  VGALoVideo,  SVGAVideo  {Magic};   SetGraphMode,
  3259.          Setcolor, etc. {Borland}
  3260.  
  3261.          Example:
  3262.          Program Test;
  3263.          uses graph, magic;
  3264.          begin
  3265.             VGAHiVideo;
  3266.             rectangle(10,10,20,20);
  3267.             WaitForUser;
  3268.             CleanUp;
  3269.          end.
  3270.  
  3271.          Performance of example:
  3272.          The  system  is  put  in VGA high-resolution graphics mode. A
  3273.          small rectangle is displayed in the upper left corner of  the
  3274.          screen until any key is pressed.
  3275.          *************************************************************
  3276.          VMode - Global Variable - byte
  3277.  
  3278.          Description:
  3279.          VMode  is used by the Magic unit to keep track of which video
  3280.          mode is currently being used.  These are the options:
  3281.  
  3282.            VMode     Which is:                     Procedure to get:
  3283.            =====     ============================  =================
  3284.              0       text video                    TextVideo
  3285.              1       CGA-Hi 640 x 200 2-color      CGAHiVideo
  3286.              2       CGA-Lo 320 x 200 4-color      CGALoVideo
  3287.              3       EGA-Lo 640 x 200 16-color     EGALoVideo
  3288.              4       EGA-Hi 640 x 350 16-color     EGAHiVideo
  3289.              5       Hercules 720 x 348 2-color    HercVideo
  3290.              6       VGA-Hi 640 x 480 16-color     VGAHiVideo
  3291.              7       VGA-Lo 320 x 200 256-color    VGALoVideo
  3292.              8       Super-VGA 640 x 480 256-color SVGAVideo
  3293.  
  3294.          Considerations:
  3295.          Manually changing VMode is not recommended.
  3296.          *************************************************************
  3297.          WaitForUser - Procedure
  3298.  
  3299.          Description:
  3300.             This  simple  procedure stalls the computer until the user
  3301.          presses a key or clicks a mouse button.
  3302.  
  3303.          See Also:
  3304.          Present.Init, XReadKey
  3305.  
  3306.          Example:
  3307.          Program Test;
  3308.          uses graph, magic;
  3309.          begin
  3310.             BestVideo;
  3311.             Triplex;
  3312.             OutTextXY(100,90,'Press any key');
  3313.             WaitForUser;
  3314.             CleanUp;
  3315.          end.
  3316.          *************************************************************
  3317.          Waste - Procedure
  3318.  
  3319.          Description:
  3320.              This  procedure  makes  sure  there  is  nothing  in  the
  3321.          keyboard buffer and if a  mouse  is  installed,  waits  until
  3322.          there  are  no mouse buttons pressed.  U is assigned #126, an
  3323.          uncommon ASCII character.
  3324.  
  3325.          Considerations:
  3326.             Waste  is automatically called by Dialog, Menu, GetYN, and
  3327.          GetAnyKey.
  3328.  
  3329.          See Also:
  3330.          Present.Init, XReadKey.
  3331.  
  3332.          Example:
  3333.          Program Test;
  3334.          uses crt, magic;
  3335.          begin
  3336.              writeln('Without Waste, keyboard buffer could cause');
  3337.              writeln('portions of the program to skid past before');
  3338.              writeln('the user knows what is happening');
  3339.              Waste;
  3340.              U := XReadKey;
  3341.              clrscr;
  3342.              writeln('This is a problem when the user holds a key');
  3343.              writeln('down too long');
  3344.              Waste;
  3345.              U := XReadKey;
  3346.              clrscr;
  3347.          end.
  3348.  
  3349.          Performance of example:
  3350.              Three lines appear on the screen. The keyboard buffer  is
  3351.          cleared  out and the program waits until no mouse buttons are
  3352.          pressed.  Then  the  program  waits  for a key to be pressed.
  3353.          Then the screen is cleared and two more lines of text appear.
  3354.          Again,  Waste clears the buffer and waits if a  mouse  button
  3355.          is pressed, and then waits for the user to do something. Then
  3356.          the screen clears and the program terminates.
  3357.          *************************************************************
  3358.          XClear - Procedure
  3359.  
  3360.          Description:
  3361.             Clears  the  screen  and  sets  the  background  color  to
  3362.          MainBack.
  3363.  
  3364.          Considerations:
  3365.             You may not  get  the  effect  expected  when  in  CGA  or
  3366.          Hercules  modes  if  the  selected MainBack color is not  one
  3367.          in the current color palette.
  3368.             Background is  always  set  to  black  when  switching  to
  3369.          another video mode.  You can call XClear after such a switch.
  3370.  
  3371.          See Also:
  3372.          BestVideo,   HercVideo,   CGAHiVideo,   CGALoVideo,   EGAVido
  3373.          {Magic}; SetGraphMode, Setcolor, etc. {Borland}
  3374.  
  3375.          Example:
  3376.          Program Test;
  3377.          uses crt, graph, magic;
  3378.          begin
  3379.             VGAHiVideo;
  3380.             rectangle(10,10,20,20);
  3381.             Sent[1] := 'Press any key...';
  3382.             Present.Init(30,30);
  3383.             MainBack := Red;
  3384.             repeat until keypressed;
  3385.             XClear;
  3386.             Sent[1] := 'Press any key...';
  3387.             Present.Init(400,400);
  3388.             Waste;
  3389.             WaitForUser;
  3390.          end.
  3391.          *************************************************************
  3392.          XReadLn - Function
  3393.  
  3394.          Description:
  3395.             You  will  find  this very useful in database applications
  3396.          where the user has to  fill  in  blanks  in  a  form.  Unlike
  3397.          Borland's  Readln  procedure  this  allows  you  to limit the
  3398.          length of a string the user can type.
  3399.             This is similar to  Turbo  Pascal's GoToXY  combined  with
  3400.          ReadLn.  XReadLn  need three integer variables. The first two
  3401.          are  the  x  and   y   screen   coordinates of the upper left
  3402.          corner of the place where the user's input will be displayed.
  3403.          X is the horizontal position and y is the vertical.  In  text
  3404.          video mode the upper left corner of the screen is 1,1 and the
  3405.          lower  right  corner  is  80,25.  In graphics modes the upper
  3406.          left corner is 0,0 and the lower right varies.   In  the  CGA
  3407.          320x200  mode,  for instance, the lower right corner would be
  3408.          319,199.
  3409.             The  last  number required, HowLong, is an integer for the
  3410.          number of characters you will allow in the string.   Example:
  3411.          if  you  have  a  form in which the user is to type a 4-digit
  3412.          number in a space, you call XReadLn with the x and y position
  3413.          of the start of the space, then 4, to limit the length of the
  3414.          number the user may enter to 4 digits. When the user  presses
  3415.          [Esc]  or  [Enter]  or  clicks  a  mouse  button,  XReadLn is
  3416.          finished.
  3417.  
  3418.          Considerations:
  3419.             XReadKey  calls  Waste  before  any  other action. Maximum
  3420.          string length is 75 characters.
  3421.             This function is useful  for  reading  from  the  keyboard
  3422.          only, not for reading files.
  3423.             Always  set  textcolor  and  textbackground before calling
  3424.          XReadLn, because otherwise, it will  use  the  most  recently
  3425.          assigned colors, which might  be  Shadow and Border, (default
  3426.          black and black!) after a pop-up box.
  3427.             No automatic centering is available.  Negative coordinates
  3428.          will have unpredictable results - probably a crash!
  3429.  
  3430.          See Also:
  3431.          XReadLn, Waste {Magic}; Readln, Textcolor, Textbackground
  3432.           {Borland}
  3433.  
  3434.          Example:
  3435.          Program Test;
  3436.          uses crt,magic;
  3437.          var
  3438.             namestring : string;
  3439.          begin
  3440.             gotoxy(1,10); write('What is your name?');
  3441.             textcolor(white); textbackground(blue);
  3442.             namestring := XReadLn(20,10,40);
  3443.          end.
  3444.  
  3445.          Performance of example:
  3446.             At  1,10,  "What  is your name?" appears on the screen. At
  3447.          the end of this  line  a  cursor  appears  and  the  user  is
  3448.          expected to type a  name.  The  user's text will be white and
  3449.          the  background  color  will  be  blue.  The user cannot type
  3450.          beyond 40 characters.  When the user presses [Enter] or [Esc]
  3451.          or  clicks  a  mouse button, the program ends. Crt must be in
  3452.          the Uses line because GotoXY is a procedure  within  the  Crt
  3453.          unit (Turbo.tpl).
  3454.          *************************************************************
  3455.          Zx, Zy - Global Variables - integers
  3456.  
  3457.          Description:
  3458.          Zx  and  Zy  are  global  integer variables which essentially
  3459.          replace getmaxx and getmaxy.
  3460.  
  3461.          Example:
  3462.          program test;
  3463.          uses graph,magic;
  3464.          begin
  3465.             BestVideo;
  3466.             SetTextJustify(CenterText,CenterText);
  3467.             OutTextXY((Zx div 2,Zy div 2,
  3468.               'This text is centered on the screen');
  3469.             WaitForUser;
  3470.          end.
  3471.          *************************************************************
  3472.  
  3473.                      ADVANTAGES OF HAVING THE SOURCE CODE:
  3474.  
  3475.          *  With  the  easy-to-understand  source  code,  you can make
  3476.          modifications to customize it exactly to your needs.
  3477.  
  3478.          * You can learn many 'secret' or hard to  find  Turbo  Pascal
  3479.          programming techniques.
  3480.  
  3481.          * You can modify Pascal Magic to suit your OOP needs.
  3482.  
  3483.          *  Even  though  Magic.tpu  takes  little room and runs quite
  3484.          fast, and even though Turbo Pascal is  very  smart  and  only
  3485.          builds code that is actually called in to .EXE files, you can
  3486.          strip down Magic.Tpu for even greater efficiency.
  3487.  
  3488.          * You can use portions of the source code as  a  frame  work,
  3489.          changing  this  or  that, inserting your own stuff, and build
  3490.          amazing programs of your own invention.
  3491.  
  3492.          * You can look at  my  approach  to  programming  and  laugh,
  3493.          possibly  commenting  under  your  breath about how you would
  3494.          have done it better.  Then, with  the  source  code  in  your
  3495.          possession, you can do it better!
  3496.  
  3497.          Notice: This is shareware. Feel free to copy  and  distribute
  3498.          without  modification.   If  you use any portion of the Magic
  3499.          Unit in your programs then registration is a legal necessity.
  3500.          Send  $39.95  to  Another Company.  Complete, well-documented
  3501.          easy-to-understand source code is available. For registration
  3502.          plus  registration,  send  $79.90.   Please  add  $3  for  US
  3503.          postage, ($5-Canada; $7-Overseas).  If you require 3.5"  disk
  3504.          size, please add $1.
  3505.  
  3506.          Send US funds drawn on a US bank to:
  3507.  
  3508.                                 Another Company
  3509.                                  P.O. Box 298
  3510.                               Applegate, OR 97530
  3511.                                       USA
  3512.                                  503-846-7884
  3513.  
  3514.  
  3515.          Even though this seems quite bug-free to me,  it  is  version
  3516.          2.0  and  you may find a surprise or two. I make no warranty.
  3517.          Thanks for trying this software.  Please feel free to  submit
  3518.          bug reports, which I will turn into fixes in later versions.
  3519.  
  3520.                                                            - Jeff -
  3521.                                                      November 11, 1992
  3522.  
  3523.          P.S.
  3524.          If  you require technical assistance, you can try to phone me
  3525.          at 503-846-7884. Best bet is 9-5 weekdays, but I'm not always
  3526.          available.
  3527.  
  3528.          P.S. #2
  3529.          Since you are going to write  some  wonderful  programs,  you
  3530.          might as well start making money with them! You won't have to
  3531.          work  in  an  office doing programming for someone else.  You
  3532.          can write exactly the kind of programs you want to write, and
  3533.          make money at home!
  3534.              The  'secret'  is shareware.  Does it work?  You bet! You
  3535.          can easily have a small success, making some  extra  spending
  3536.          money  each month, or with some practice, you can have a wild
  3537.          success, and make a fine living! There are some  millionaires
  3538.          who   make   their   ever-growing  fortune  entirely  through
  3539.          shareware.
  3540.              ANOTHER  COMPANY  shows  you everything.  Besides our own
  3541.          shareware  successes,  including  WRITER'S   DREAM,   BICYCLE
  3542.          TUNE-UP  AND  REPAIR,  MONEY, THE MULTIMEDIA WORKSHOP, BETTER
  3543.          EYESIGHT,  WHAT'S IN THAT BOX?, 21ST CENTURY ALMANAC, and THE
  3544.          UNIVERSAL CONVERTER, we have researched the shareware market,
  3545.          we have interviewed other shareware authors and have  learned
  3546.          about all sides of the rapidly expanding shareware business.
  3547.               We show you how  to  write  programs  that  capture  the
  3548.          public's   interest,   how   to   make  sure  your  customers
  3549.          'register', and how to get money by other means through  your
  3550.          shareware.  We  show  you  more. We show you frequency charts
  3551.          indicating which  types  of  programs  sell  best,  we  offer
  3552.          suggestions  for  programs as yet unwritten,  we  talk  about
  3553.          your  on-disk  instruction  manuals,  we even show you how to
  3554.          write user-friendliness into your programs.
  3555.               Can  you  succeed without  SUCCESS WITH SHAREWARE?  Yes!
  3556.          But  why do  it  the  hard  way?  We  have  learned  all  the
  3557.          super-professional   approaches,   the   pitfalls   and   the
  3558.          shortcuts. We'll tell you all about it, and then  instead  of
  3559.          stumbling  around  for  the  first couple of years, you'll be
  3560.          a professional from the start!
  3561.              To get your copy of SUCCESS WITH SHAREWARE! (which is not
  3562.          shareware, itself - only  available  from  Another  Company),
  3563.          send  $29.95  plus  postage  ($3-US, $5-Canada, $7-Overseas).
  3564.          Please add $1 if you need 3.5" disk size.
  3565.  
  3566.  
  3567.          You can order products by writing your order on plain  paper,
  3568.          or  by  printing the included ASCII file called Order.frm, or
  3569.          by phoning 1-503-846-7884, generally weekdays between  9  and
  3570.          5, west coast time.
  3571.  
  3572.  
  3573.