home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / CMAGIC.ZIP / MAGIC.3 < prev    next >
Text File  |  1992-09-06  |  57KB  |  1,450 lines

  1.  
  2.                             Continued from MAGIC.2
  3.  
  4.          *************************************************************
  5.          void resetmouse(void) - function
  6.  
  7.          Usage: resetmouse()
  8.  
  9.          Description:
  10.             This  restores  the  mouse  situation  to   it's   default
  11.          parameters. The mouse pointer will be relocated to the center
  12.          of  the  screen  and the left, center (if equipped) and right
  13.          mouse button status will be 0. The mouse will be  initialized
  14.          to the current graphics or text mode.
  15.  
  16.          Considerations:
  17.               Resetmouse()  is   automatically   implemented   anytime
  18.          cgahivideo(), vgalovideo(), bestvideo(), etc are called.
  19.  
  20.          See also:
  21.          poll(),     pointertoxy(),     pointeron(),     pointeroff(),
  22.          setmousecolumns(), setmouserows()
  23.  
  24.          *************************************************************
  25.          void restore(void) - function
  26.  
  27.          Usage: restore()
  28.  
  29.          Description:
  30.             Restore() replaces the  screen  contents  with  a  picture
  31.          saved  before  the last call to pop().
  32.             Getanykey(),  getyn(), dialog(), or menu(), call restore()
  33.          automatically when they finish, but pop() does not. Restore()
  34.          also frees the memory which was held  for  the  saved  screen
  35.          image.
  36.  
  37.          Considerations:
  38.              In  graphics mode, it is easily possible to exceed avail-
  39.          able RAM space.  Call restore() as soon as possible when done
  40.          with a pop-up. In text  mode,  repeated  calls  to  restore()
  41.          brings  back  the  image preceding each pop() up to 10 layers
  42.          deep. Restore() is a smart procedure, if  called  more  times
  43.          than the number of stored screens, it has no effect.
  44.  
  45.          See Also
  46.          pop(), clearsents()
  47.  
  48.          Example:
  49.  
  50.          #include <magic.h>
  51.          #include <dos.h>
  52.          void main() {
  53.             magic_setup();
  54.             pile("This box is going to");
  55.             pile("be difficult to read");
  56.             pop(1,1);
  57.             clearsents();
  58.             delay(1000);
  59.             pile("because this screen");
  60.             pile("is going to cover it up");
  61.             pile("Press any key to get rid");
  62.             pile("of this box");
  63.             pop(5,2);
  64.             waitforuser();
  65.             restore();
  66.             waitforuser();
  67.             restore();
  68.             delay(1000);
  69.             cleanup();
  70.          }
  71.  
  72.          Performance of example:
  73.             A box containing two lines of text appears in the  extreme
  74.          upper  left  corner,  then  one second later, a four-line box
  75.          partially covers it up.  When the user  presses  a  key,  the
  76.          second  box  disappears  so  that  the  first one can be seen
  77.          clearly. When the user presses a key  again,  the  first  box
  78.          disappears  leaving a blank screen. After a one second delay,
  79.          the program terminates cleanly.
  80.  
  81.          *************************************************************
  82.          void restoresettings(void) - function
  83.  
  84.          Usage: restoresettings()
  85.  
  86.          Description:
  87.              This   function   is   used  after  a  previous  call  to
  88.          savesettings(). Savesettings() memorizes linestyle, viewport,
  89.          color and font information when it is called.  Then  you  can
  90.          temporary  change these settings by using pop(), or functions
  91.          of  your  own.   When  done,   call   restoresettings()   and
  92.          linestyle,  viewport, text and justification settings will be
  93.          reset to their previous condition.
  94.  
  95.          Considerations:
  96.              Restoresettings()   has   no   effect   in   text   mode.
  97.          Getanykey(), getyn(), dialog() and menu() call savesettings()
  98.          and restoresettings() automatically.
  99.  
  100.          See Also: savesettings(), pop()
  101.  
  102.          Example:
  103.              #include <magic.h>
  104.              #include <graphics.h>
  105.              void main(){
  106.                 magic_setup();
  107.                 bestvideo();
  108.                 triplex();
  109.                 setcolor(YELLOW);
  110.                 setlinestyle(1,0,3);
  111.                 settextjustify(LEFT_TEXT,CENTER_TEXT);
  112.                 .
  113.                 .
  114.                 savesettings();
  115.                 setcolor(GREEN);
  116.                 gothic();
  117.                 setlinestyle(0,0,1);
  118.                 settextjustify(CENTER_TEXT,BOTTOM_TEXT);
  119.                 .
  120.                 .
  121.                 restoresettings();
  122.                 outtextxy(10,10,"Everything is as it was.");
  123.                 waitforuser();
  124.                 cleanup();
  125.              }
  126.  
  127.          Performance of example: Triplex  font  is  selected,  current
  128.          drawing  color  is  set to yellow, line style is set to thick
  129.          dotted line, and justification is set to left and center.
  130.              Some  other,  unidentified  programming   happens,   then
  131.          savesettings()  is  called.   Current  color is set to GREEN,
  132.          font  to  Gothic,  linestyle  becomes   thin,   dotted,   and
  133.          justification   is   set   to   center,bottom.    Some   more
  134.          unidentified programming happens.
  135.              Then restoresettings() is called, and everything  reverts
  136.          to  the  settings  at  the  time  savesettings()  was called.
  137.          Therefore, the string, "Everything is at  it  was."  will  be
  138.          shown  in the previous color of YELLOW, in Triplex font, with
  139.          left and center justification.
  140.  
  141.          *************************************************************
  142.          char right - Global Variable
  143.  
  144.          Usage: /* example */ if (right) break;
  145.  
  146.          Description:
  147.             Right  is a global char variable used to record the status
  148.          of the right mouse button.  If right = 1 then the right mouse
  149.          button has been pressed, otherwise right = 0.
  150.  
  151.          Considerations:
  152.             The status of right will change with every call to poll(),
  153.          waste(), resetmouse() or procedures within Magic which handle
  154.          text or pop up boxes.
  155.  
  156.          See Also: poll(), waste(), ResetMouse(), center, left
  157.  
  158.          Example:
  159.          #include <magic.h>
  160.          void main() {
  161.             magic_setup();
  162.             waste();
  163.             pile("Nothing will change until you click the");
  164.             pile("right mouse button");
  165.             pop(-1,-1);
  166.             do poll; while (!right);
  167.          }
  168.  
  169.          Performance of example:
  170.             A box containing two lines of text will stay on the screen
  171.          until the user clicks the right mouse  button.   The  program
  172.          will then terminate.
  173.  
  174.          *************************************************************
  175.          void sansserif(void) - function
  176.  
  177.          Usage: sansserif()
  178.  
  179.          Description:
  180.          This function causes outtext() and  outtextxy()  to  generate
  181.          text in the "sansserif" stroked font.
  182.  
  183.          Considerations:
  184.              SANS.CHR  is linked into .EXE file and RAM usage and disk
  185.          space  requirements  increase.
  186.  
  187.          See Also:
  188.              triplex(),    little(),   gothic(),   bold(),   script(),
  189.          italic(), complex(), simple(), bitmap(), european()
  190.  
  191.          Example:
  192.          #include <magic.h>
  193.          #include <graphics.h>
  194.          void main(){
  195.             magic_setup();
  196.             bestvideo();
  197.             sansserif();
  198.             outtextxy(0,0,"SansSerif font");
  199.             waitforuser();
  200.             cleanup();
  201.          }
  202.  
  203.          Performance of example:
  204.          Program   writes   "SansSerif   font"  on  screen  using  the
  205.          "sansserif" font.
  206.  
  207.          *************************************************************
  208.          void savescreen(void) - function
  209.  
  210.          Usage: savescreen()
  211.  
  212.          Description:
  213.              Savescreen()  saves  the  current  screen image to RAM so
  214.          that it can be restored at a later time.
  215.              In text mode, the cursor location is also saved.
  216.  
  217.          Considerations:
  218.              In  graphics  modes,  savescreen()  will  hold  only  one
  219.          memorized screen at a time. In text mode, it will memorize up
  220.          to  10  screens  simultaneously.   Savescreen()   is   called
  221.          automatically by pop() and the functions which use pop().
  222.              In  text  modes,  the  last  screen  saved  is  the first
  223.          restored. They are restored in a last saved,  first  restored
  224.          order.
  225.  
  226.          See Also:
  227.          restore(), pop(), getanykey(), getyn(), dialog(), menu()
  228.  
  229.          Example:
  230.          #include <magic.h>
  231.          #include <stdio.h>
  232.          void main() {
  233.              magic_setup();
  234.              savescreen();
  235.              xclear();
  236.              printf("Whatever was here before, will be restored.");
  237.              waitforuser();
  238.              restore();
  239.          }
  240.  
  241.          Performance of example:
  242.          As  the  program  starts,  the image of the current screen is
  243.          saved to RAM, the screen is cleared and a  sentence  appears.
  244.          When  the  user  presses  any  key, the previous screen image
  245.          reappears and the previous cursor position is restored.
  246.  
  247.          *************************************************************
  248.          void savescreeng(void) - function
  249.  
  250.          Usage: This function is used internally by the Magic library.
  251.          Direct use of this function is not recommended.
  252.  
  253.          Description:
  254.              When in a graphics mode, savescreen() passes  control  to
  255.          this function.
  256.  
  257.          *************************************************************
  258.          void savesettings(void) - function
  259.  
  260.          Usage: savesettings()
  261.  
  262.          Description:
  263.              Before  a  call  to  pop()  or  any programming which may
  264.          affect current settings of linestyle, font, justification  or
  265.          color,  call  this function to memorize the current settings.
  266.          When  you  want  to  restore  the  memorized  settings,  call
  267.          restoresettings().
  268.  
  269.          Considerations:
  270.              Getanykey(),    getyn(),   dialog()   and   menu()   call
  271.          savesettings() and restoresettings() automatically.
  272.  
  273.          Example:
  274.              #include <magic.h>
  275.              #include <graphics.h>
  276.              void main(){
  277.                 magic_setup();
  278.                 bestvideo();
  279.                 triplex();
  280.                 setcolor(YELLOW);
  281.                 setlinestyle(1,0,3);
  282.                 settextjustify(LEFT_TEXT,CENTER_TEXT);
  283.                 .
  284.                 .
  285.                 savesettings();
  286.                 setcolor(GREEN);
  287.                 gothic();
  288.                 setlinestyle(0,0,1);
  289.                 settextjustify(CENTER_TEXT,BOTTOM_TEXT);
  290.                 .
  291.                 .
  292.                 restoresettings();
  293.                 outtextxy(10,10,"Everything is as it was.");
  294.                 waitforuser();
  295.                 cleanup();
  296.              }
  297.  
  298.          Performance of example: Triplex  font  is  selected,  current
  299.          drawing  color  is  set to yellow, line style is set to thick
  300.          dotted line, and justification is set to left and center.
  301.              Some  other,  unidentified  programming   happens,   then
  302.          savesettings()  is  called.   Current  color is set to GREEN,
  303.          font  to  Gothic,  linestyle  becomes   thin,   dotted,   and
  304.          justification   is   set   to   center,bottom.    Some   more
  305.          unidentified programming happens.
  306.              Then restoresettings() is called, and everything  reverts
  307.          to  the  settings  at  the  time  savesettings()  was called.
  308.          Therefore, the string, "Everything is at  it  was."  will  be
  309.          shown  in the previous color of YELLOW, in Triplex font, with
  310.          left and center justification.
  311.  
  312.          *************************************************************
  313.          char screencount - Global Variable
  314.  
  315.          Usage:  This is used internally by the Magic library.  Direct
  316.          manipulation is not recommended.
  317.  
  318.          Description:
  319.              In text mode, up to 10 calls to pop(), dialog(), getyn(),
  320.          getanykey() or menu() can overlap each other.  Each structure
  321.          of  screen  information  saved  under  the  pop-up  boxes  is
  322.          numbered  and  tracked with screencount.  When screencount is
  323.          0, no images are currently saved.
  324.  
  325.          *************************************************************
  326.          void script(void) - function
  327.  
  328.          Usage: script()
  329.  
  330.          Description:
  331.          This function causes outtext() and  outtextxy()  to  generate
  332.          text in the "script" stroked font.
  333.  
  334.          Considerations:
  335.              SCRI.CHR  is linked into .EXE file and RAM usage and disk
  336.          space  requirements  increase.   This font will not work with
  337.          older versions of Turbo C.
  338.  
  339.          See Also:
  340.              triplex(),  little(),  gothic(),   sansserif(),   bold(),
  341.          italic(), complex(), simple(), bitmap(), european()
  342.  
  343.          Example:
  344.          #include <magic.h>
  345.          #include <graphics.h>
  346.          void main(){
  347.             magic_setup();
  348.             bestvideo();
  349.             script();
  350.             outtextxy(0,0,"Script font");
  351.             waitforuser();
  352.             cleanup();
  353.          }
  354.  
  355.          Performance of example:
  356.          Program  writes  "Script  font"  on screen using the "script"
  357.          font.
  358.  
  359.          *************************************************************
  360.          char sent[81][46] - Global Variable
  361.  
  362.          Usage: /* example */ strcpy(sent[1],"test");
  363.  
  364.          Description:
  365.          Sent[81][46]  is  a  two-dimensional array of characters.  If
  366.          you are new to  C,  don't  think  of  it  that  way, however.
  367.          Instead,  think  of it as a collection of up to 46 strings or
  368.          sentences.  Each string can be up to 80 characters long, plus
  369.          the necessary, C-standard, null-termination,  which  puts  an
  370.          ASCII  #0 at the end of each string to keep track of how long
  371.          it is.  (Many C functions look for  the  #0  at  the  end  of
  372.          strings.)
  373.              Sent[] is used by pop() and the function which use pop(),
  374.          such  as  getanykey(), getyn(), dialog() and menu().  You can
  375.          access  it  automatically  with pile() or directly  with  the
  376.          Borland/Turbo  C/C++  string  handling  functions   such   as
  377.          strcpy(),  strcat(), printf(), etc. Most often, you work with
  378.          one string from sent[] at a time, and you access  the  string
  379.          you want with a variable, as in the usage example above.
  380.             Use the function, figurehowmany() to determine the current
  381.          number  of  strings  in  use.   Use clearsents() to reset all
  382.          strings in [sent] to "null" or empty.
  383.  
  384.          Considerations:
  385.             Although sent[] allows up  to  46  strings  of  up  to  80
  386.          characters  each,  in  many  uses,  you  can't use that much.
  387.          Pop() and the functions which use pop() require space on  the
  388.          screen  for borders and shadows.  In standard text mode (80 x
  389.          25) you can actually use only 75 characters  per  string  and
  390.          only up to 22 strings.
  391.             There is a limit to the maximum size of pop-up boxes using
  392.          sent[]. For instance, in VGA-HI graphics mode, the  limit  is
  393.          about  20  lines of text with the longest line being about 40
  394.          characters long.
  395.  
  396.          See Also:
  397.          pop(),  getanykey(),  getyn() dialog(), menu(), clearsents(),
  398.          answer(),      restore(),      pile(),       figurehowmany(),
  399.          figurehowlong(), howmany, howlong
  400.  
  401.          Example:
  402.          #include <magic.h>
  403.          #include <string.h>
  404.          void main() {
  405.             magic_setup();
  406.             strcat(sent[1],"This is a way to avoid");
  407.             strcat(sent[2],"the pile() function.");
  408.             getanykey(-1,-1);
  409.          }
  410.  
  411.          Performance of example:
  412.          Two  strings are assigned to sent[].  They are displayed with
  413.          getanykey() until the user presses a key.
  414.  
  415.          *************************************************************
  416.          void setmousecolumns(int high, int low) - function
  417.  
  418.          Usage: setmousecolumns(high,low)
  419.  
  420.          Description:
  421.          You can limit the travel of the  mouse  on  the  screen  with
  422.          setmousecolumns()   and   setmouserows().   Setmousecolumns()
  423.          needs two integer numbers, the first is  the  maximum  column
  424.          that  the  mouse  is  allowed  and  the second is the minimum
  425.          column.
  426.  
  427.          Considerations:
  428.             Text mode is usually based on CGA high-res (640 x 200). To
  429.          work  with a specific text location, divide the mouse x and y
  430.          coordinates by 8. To place a character in the third column of
  431.          the second row of the screen (near the upper left corner) you
  432.          would work at coordinate 16,8.
  433.             Do not use this procedure unless a mouse is installed.
  434.             This will work fine in all text and graphics modes.   Full
  435.          screen  size  for  mouse movement in standard text mode (80 x
  436.          25) characters is the same as CGA-HI or  EGA-Lo,  640  x  200
  437.          pixels.  Each character essentially occupies a space of 8 x 8
  438.          pixels,  although  in  text  mode, the mouse moves a block (8
  439.          pixels) at a time. So, to  restrict  mouse  movement  to  the
  440.          upper   left  quarter  of  the  screen  you  would  do  this:
  441.          setmousecolumns(319,0); setmouserows(99,0);.
  442.  
  443.          See Also:
  444.          poll(), pointertoxy(), setmouserows(), mouseinstalled()
  445.  
  446.          Example:
  447.          #include <magic.h>
  448.          void main() {
  449.             magic_setup();
  450.             vgavideo();
  451.             setmousecolumns(319,0);
  452.             setmouserows(199,0);
  453.             pointeron();
  454.             do poll; while (!left);
  455.          }
  456.  
  457.          Performance of example:
  458.             This  example  sets  the  video mode to VGA but allows the
  459.          mouse to move only within the upper left corner of the screen
  460.          as if working with the more limited resolution of CGA 4-color
  461.          mode.
  462.  
  463.          *************************************************************
  464.          void setmouserows(int high, int low) - function
  465.  
  466.          Usage: setmouserows(high,low)
  467.  
  468.          Description:
  469.          You can limit the travel of the  mouse  on  the  screen  with
  470.          setmousecolumns()  and  setmouserows().  Setmouserows() needs
  471.          two integer numbers, the first is the maximum  row  that  the
  472.          mouse is allowed and the second is the minimum row.
  473.  
  474.          Considerations:
  475.             Text mode is usually based on CGA high-res (640 x 200). To
  476.          work  with a specific text location, divide the mouse x and y
  477.          coordinates by 8. To place a character in the third column of
  478.          the second row of the screen (near the upper left corner) you
  479.          would work at coordinate 16,8.
  480.             Do not use this procedure unless a mouse is installed.
  481.             This will work fine in all text and graphics  modes.   See
  482.          setmousecolumns() for more details.
  483.  
  484.          See Also:
  485.          poll(), pointertoxy(), setmousecolumns(), mouseinstalled()
  486.  
  487.          Example:
  488.          #include <magic.h>
  489.          void main() {
  490.             magic_setup();
  491.             vgavideo();
  492.             setmousecolumns(319,0);
  493.             setmouserows(199,0);
  494.             pointeron();
  495.             do poll; while (!left);
  496.          }
  497.  
  498.          Performance of example:
  499.             This  example  sets  the  video mode to VGA but allows the
  500.          mouse to move only within the upper left corner of the screen
  501.          as if working with the more limited resolution of CGA 4-color
  502.          mode.
  503.  
  504.          *************************************************************
  505.          char shadow - Global Variable
  506.  
  507.          Usage: shadow = color;
  508.  
  509.          Description:
  510.          This  sets  the color of shadows at the bottom and right edge
  511.          of pop-up text boxes, where 'color' is an integer from  0  to
  512.          15  or  a  color  constant  as defined GRAPHICS.H or CONIO.H.
  513.          Works in graphics and text mode.
  514.  
  515.          Considerations:
  516.          May  not  have the expected effect when used with the limited
  517.          palettes of 4-color CGA (mode  0,1  or  2),  2-color  CGA  or
  518.          Hercules. In text mode, only 8 colors  are  available: 0 - 7.
  519.  
  520.          See  also:  maintext,  mainback,  boxtext,  boxback, bartext,
  521.          barback, border.
  522.  
  523.          Example:
  524.          #include <magic.h>
  525.          void main() {
  526.              magic_setup();
  527.              pile("test");
  528.              shadow = GREEN;
  529.              getanykey(-1,-1);
  530.          }
  531.  
  532.          Performance of example:
  533.             A text box pops up with a green shadow.
  534.  
  535.          *************************************************************
  536.          void simple(void) - function
  537.  
  538.          Usage: simple()
  539.  
  540.          Description:
  541.          This function causes outtext() and  outtextxy()  to  generate
  542.          text in the "simple" (a.k.a. "simplex") stroked font.
  543.  
  544.          Considerations:
  545.              SIMP.CHR  is linked into .EXE file and RAM usage and disk
  546.          space requirements increase.  This font will  not  work  with
  547.          older versions of Turbo C.
  548.  
  549.          See Also:
  550.              triplex(),  little(),  gothic(),  sansserif(),  script(),
  551.          italic(), complex(), simple(), bitmap(), european()
  552.  
  553.          Example:
  554.          #include <magic.h>
  555.          #include <graphics.h>
  556.          void main(){
  557.             magic_setup();
  558.             bestvideo();
  559.             simple();
  560.             outtextxy(0,0,"Simplex font");
  561.             waitforuser();
  562.             cleanup();
  563.          }
  564.  
  565.          Performance of example:
  566.          Program  writes  "Simplex  font" on screen using the "simple"
  567.          font.
  568.  
  569.          *************************************************************
  570.          void sorry(void) - function
  571.  
  572.          Usage: sorry()
  573.  
  574.          Description:
  575.             Sorry()  makes  a  sound typically indicating an incorrect
  576.          response to a question.
  577.  
  578.          Considerations:
  579.             The  global  variable  musicon  must  be greater than 0 or
  580.          sorry() will not make a sound.
  581.  
  582.          See Also:
  583.          musicon, twinkle(), pink(),  sounddown(),  soundup()  {Magic}
  584.          sound(), nosound(), delay() {Borland}
  585.  
  586.          Example:
  587.          include <magic.h>
  588.          void main() {
  589.             magic_setup();
  590.             musicon = 1;
  591.             sorry();
  592.          }
  593.  
  594.          Performance of example:
  595.              The sorry sound plays.
  596.  
  597.          *************************************************************
  598.          void sounddown(void) - function
  599.  
  600.          Usage: sounddown()
  601.  
  602.          Description:
  603.             Sounddown()  makes  a  sound typically indicating an event
  604.          has completed.  It is called automatically by  restore()  and
  605.          the functions that use restore() when musicon > 0.
  606.  
  607.          Considerations:
  608.             The  global  variable  musicon  must  be greater than 0 or
  609.          sounddown() will not make a sound.
  610.  
  611.          See Also:
  612.          musicon,   sorry(),   twinkle(),  pink(),  soundup()  {Magic}
  613.          sound(), nosound(), delay() {Borland}
  614.  
  615.          Example:
  616.          include <magic.h>
  617.          void main() {
  618.             magic_setup();
  619.             musicon = 0; /* temporary lock out sounds so     */
  620.                          /* getanykey()'s sound effect won't */
  621.                          /* interfere.                       */
  622.  
  623.             pile("Do you want to hear sounddown?");
  624.             getanykey(-1,-1);
  625.             if (u == 'Y') musicon = 1;
  626.             sounddown();
  627.          }
  628.  
  629.          Performance of example:
  630.              If  the  user   answers   the   question   affirmatively,
  631.          sounddown() will play it's sound effect.
  632.  
  633.          *************************************************************
  634.          void soundup(void) - function
  635.  
  636.          Usage: soundup()
  637.  
  638.          Description:
  639.              Soundup()  makes  a  sound   typically   indicating   the
  640.          beginning  of  an event.  It is called automatically by pop()
  641.          and the functions that use pop() when musicon > 0.
  642.  
  643.          Considerations:
  644.             The  global  variable  musicon  must  be greater than 0 or
  645.          sounddown() will not make a sound.
  646.  
  647.          See Also:
  648.          musicon,  sorry(),  twinkle(),  pink(),  sounddown()  {Magic}
  649.          sound(), nosound(), delay() {Borland}
  650.  
  651.          Example:
  652.          include <magic.h>
  653.          void main() {
  654.             magic_setup();
  655.             musicon = 0; /* temporary lock out sounds so     */
  656.                          /* getanykey()'s sound effect won't */
  657.                          /* interfere.                       */
  658.             pile("Do you want to hear soundup?");
  659.             getanykey(-1,-1);
  660.             if (u == 'Y') musicon = 1;
  661.             soundup();
  662.          }
  663.  
  664.          Performance of example:
  665.              If  the  user   answers   the   question   affirmatively,
  666.          soundup() will play it's sound effect.
  667.  
  668.          *************************************************************
  669.          void standardcolors(void) - function
  670.  
  671.          Usage: standardcolors()
  672.  
  673.          Description:
  674.              This is used internally by the Magic  Library  to  choose
  675.          functional  and  good  looking colors for pop(), getanykey(),
  676.          getyn(), dialog() and menu().  These colors will  work  on  a
  677.          monochrome  display  even  if  the graphics mode is 16 or 256
  678.          colors. These will also be correct if  in  CGA  modes  or  in
  679.          Hercules mode.
  680.  
  681.          Considerations:
  682.              Standardcolors()   is   called   automatically  everytime
  683.          graphics (or text) mode is changed by the  functions  in  the
  684.          Magic  library.   You  can  also  restore "default" colors by
  685.          calling this function anywhere within your program.
  686.  
  687.          See    Also:    textvideo(),    bestvideo(),    cgalovideo(),
  688.          cgahivideo(),   egalovideo(),   egahivideo(),    hercvideo(),
  689.          vgalovideo(),  vgahivideo(), bestvideo(), maintext, mainback,
  690.          boxtext, boxback, bartext, barback, border, shadow.
  691.  
  692.          Example:
  693.              #include<magic.h>
  694.              #include<graphics.h>
  695.              void main(){
  696.                 magic_setup();
  697.                 bestvideo();
  698.                 mainback = BLUE;
  699.                 boxtext = WHITE;
  700.                 .
  701.                 .
  702.                 standardcolors();
  703.                 pile("No matter what we did to the colors");
  704.                 pile("earlier in this program, they'll be");
  705.                 pile("ok now!");
  706.                 getanykey(-1,-1);
  707.              }
  708.  
  709.          Performance of example:
  710.              Some color variables are changed early  in  the  program.
  711.          Some  unidentified  programming happens.  Standardcolors() is
  712.          called  to  restore  the default pop-up box colors.  Then two
  713.          lines are printed via getanykey() which are properly visible.
  714.  
  715.          *************************************************************
  716.          void standardvideo(void)
  717.  
  718.          Usage:  Standaradvideo() is  used  internally  by  the  Magic
  719.          Library.  Direct use of this function is not recommended.
  720.  
  721.          Description:
  722.              This  function sets up the video environment for graphics
  723.          changes.  It calls standardcolors(),  sets  the  global  char
  724.          variable vmode, and resets the mouse if installed.
  725.  
  726.          *************************************************************
  727.          void textvideo(void) - function
  728.  
  729.          Usage: textvideo()
  730.  
  731.          Description:
  732.              This returns a program from a graphics video mode to text
  733.          mode, the default startup condition. The screen is cleared.
  734.  
  735.          Considerations:
  736.              Any memory held for a saved screen from a pop-up box will
  737.          be released.  The global char variable vmode is set to 0.
  738.  
  739.          See Also:
  740.          bestvideo(),    cgalovideo(),    cgahivideo()    hercvideo(),
  741.          egalovideo() egahivideo(), vgalovideo(), vgahivideo()
  742.  
  743.          Example:
  744.          #include <magic.h>
  745.          void main() {
  746.             magic_setup();
  747.             bestvideo();
  748.             pile("This is graphics mode");
  749.             pile("Press any key to see text mode");
  750.             getanykey(-1,-1);
  751.             textvideo();
  752.             pile("This is text mode");
  753.             pile("Press any key to quit");
  754.             getanykey(-1,-1);
  755.          }
  756.  
  757.          Performance of example:
  758.             A  box  pops up in the best graphics mode the computer can
  759.          display. When the user presses a key, the  computer  switches
  760.          to  text  video  mode  and another box appears until the user
  761.          presses a key again.
  762.  
  763.          *************************************************************
  764.          void triplex(void) - function
  765.  
  766.          Usage: triplex()
  767.  
  768.          Description:
  769.          This function causes outtext() and  outtextxy()  to  generate
  770.          text in the "triplex" stroked font.
  771.  
  772.          Considerations:
  773.              TRIP.CHR is linked into .EXE file and RAM usage and  disk
  774.          space  requirements  increase.
  775.  
  776.          See Also:
  777.              bold(),  little(),   gothic(),   sansserif(),   script(),
  778.          italic(), complex(), simple(), bitmap(), european()
  779.  
  780.          Example:
  781.          #include <magic.h>
  782.          #include <graphics.h>
  783.          void main(){
  784.             magic_setup();
  785.             bestvideo();
  786.             triplex();
  787.             outtextxy(0,0,"Triplex font");
  788.             waitforuser();
  789.             cleanup();
  790.          }
  791.  
  792.          Performance of example:
  793.          Program  writes  "Triplex font" on screen using the "triplex"
  794.          font.
  795.  
  796.          *************************************************************
  797.          void twinkle(void) - function
  798.  
  799.          Usage: twinkle()
  800.  
  801.          Description:
  802.              Twinkle() makes a  sound  typically  indicating  that  an
  803.          event has completed positively.
  804.  
  805.          Considerations:
  806.             The  global  variable  musicon  must  be greater than 0 or
  807.          sounddown() will not make a sound.
  808.  
  809.          See Also:
  810.          musicon,  pink(),  bugle(),  soundup(),  sounddown()  {Magic}
  811.          sound(), nosound(), delay() {Borland}
  812.  
  813.          Example:
  814.          include <magic.h>
  815.          void main() {
  816.             magic_setup();
  817.             musicon = 0; /* temporary lock out sounds so     */
  818.                          /* getanykey()'s sound effect won't */
  819.                          /* interfere.                       */
  820.             pile("Do you want to hear twinkle?");
  821.             getanykey(-1,-1);
  822.             if (u == 'Y') musicon = 1;
  823.             twinkle();
  824.          }
  825.  
  826.          Performance of example:
  827.              If  the  user   answers   the   question   affirmatively,
  828.          twinkle() will play it's sound effect.
  829.  
  830.          *************************************************************
  831.          unsigned char u - Global Variable
  832.  
  833.          Usage: /* example */ u = getch();
  834.  
  835.          Description:
  836.             "u"  is  a  general  purpose global unsigned char variable
  837.          declared in MAGIC.H for internal use, but also available  for
  838.          any   use  within  your  program.   U  originally  stood  for
  839.          UserInput.
  840.  
  841.          Considerations:
  842.             U  is  reset by several of the functions and procedures in
  843.          the Magic library.  Do not assume the value of u will  remain
  844.          the   same   after   use   of  functions  such  as  dialog(),
  845.          xreadkey(), etc.
  846.  
  847.          Example:
  848.          #include <magic.h>
  849.          void main() {
  850.             magic_setup();
  851.             .
  852.             .
  853.             pile("Do you want to quit? (Y/N)");
  854.             getyn(-1,-1);
  855.             if (u == 'Y') exit(0);
  856.             .
  857.             .
  858.          }
  859.  
  860.          Performance of example:
  861.             If the user answers affirmatively, u will be  set  to  'Y'
  862.          and the program will end.
  863.  
  864.          *************************************************************
  865.          char vga256driver - Global Variable
  866.  
  867.          Usage: For internal use by the Magic  library  only.   Direct
  868.          manipulation of this variable is not recommended.
  869.  
  870.          Description:  A  variable  used to identify the 256-color VGA
  871.          driver.
  872.  
  873.          *************************************************************
  874.          void vgalovideo(void) - function
  875.  
  876.          Usage: vgalovideo()
  877.  
  878.          Description:
  879.          This initializes the system in VGA 256-color  graphics  mode.
  880.          VGA256  video  driver will be automatically compiled into the
  881.          .EXE  program  file,  eliminating  the  need   for   external
  882.          VGA256.BGI  file  (not  actually supplied by Borland).  Graph
  883.          mode is set to 0, 320 x 200 resolution, 256 colors.
  884.  
  885.          Considerations:
  886.          Will   not  work  on  computers  unless  equipped  with  VGA.
  887.          Graphmode is initially set to 0 (see Borland manual for  more
  888.          details).  Will not work with older Turbo C compilers.
  889.  
  890.          See Also:
  891.          bestvideo(),     cgalovideo(),    cgahivideo,    hercvideo(),
  892.          egalovideo()   egahivideo(),    vgahivideo(),    textvideo(),
  893.          cleanup() {Magic} setgraphmode(), setrgbpalette() {Borland}
  894.  
  895.          Example:
  896.          #include <magic.h>
  897.          #include <graphics.h>
  898.          void main() {
  899.             magic_setup();
  900.             vgalovideo();
  901.             setcolor(153);
  902.             rectangle(10,10,309,189);
  903.             waitforuser();
  904.             cleanup();
  905.          }
  906.  
  907.          Performance of example:
  908.          The   system  is  put  in  VGA-256  graphics  mode.  A  large
  909.          dark purple rectangle is displayed until any key is pressed.
  910.  
  911.          *************************************************************
  912.          void vgahivideo(void) - function
  913.  
  914.          Usage: vgavideo()
  915.  
  916.          Description:
  917.          This initializes the system in VGA graphics mode.  VGA  video
  918.          driver  will  be automatically compiled into the .EXE program
  919.          file, eliminating the  need  for  external  EGAVGA.BGI  file.
  920.          Graph mode is set to 2, 640 x 480 resolution, 16 colors.
  921.  
  922.          Considerations:
  923.          Will   not  work  on  computers  unless  equipped  with  VGA.
  924.          Graphmode is initially set to 2 (see Borland manual for  more
  925.          details).
  926.  
  927.          See Also:
  928.          bestvideo(),     cgalovideo(),    cgahivideo,    hercvideo(),
  929.          egalovideo()   egahivideo(),    vgalovideo(),    textvideo(),
  930.          cleanup() {Magic} setgraphmode() {Borland}
  931.  
  932.          Example:
  933.          #include <magic.h>
  934.          #include <graphics.h>
  935.          void main() {
  936.             magic_setup();
  937.             vgavideo();
  938.             rectangle(10,10,629,469);
  939.             waitforuser();
  940.             cleanup();
  941.          }
  942.  
  943.          Performance of example:
  944.          The  system is put in VGA graphics mode. A large rectangle is
  945.          displayed   until  any  key  is  pressed.
  946.  
  947.          *************************************************************
  948.          char vmode - Global Variable
  949.  
  950.          Usage: /* example */ if (vmode == 0) printf("text mode");
  951.  
  952.          Description:
  953.              Vmode  is  a  global char variable used internally by the
  954.          Magic library to keep track of the current graphics (or text)
  955.          mode.   Direct  changing of this variable is not recommended,
  956.          but you can test it to find out the current graphics mode.
  957.  
  958.          See   Also:    bestvideo(),    cgalovideo(),    cgahivideo(),
  959.          egalovideo(),    egahivideo(),   hercvideo(),   vgalovideo(),
  960.          vgahivideo() textvideo()
  961.  
  962.          Example:
  963.  
  964.          #include <magic.h>
  965.          #include <graphics.h>
  966.          #include <string.h>
  967.          void main(){
  968.            magic_setup();
  969.            bestvideo();
  970.            switch (vmode) {
  971.               case 0 : strcpy(sent[1],"text mode"); break;
  972.               case 1 : strcpy(sent[1],"CGA-HI"); break;
  973.               case 2 : strcpy(sent[1],"CGA-LO"); break;
  974.               case 3 : strcpy(sent[1],"EGA-LO"); break;
  975.               case 4 : strcpy(sent[1],"EGA-HI"); break;
  976.               case 5 : strcpy(sent[1],"Hercules"); break;
  977.               case 6 : strcpy(sent[1],"VGA-HI"); break;
  978.               case 7 : strcpy(sent[1],"VGA-LO");
  979.             }
  980.             strcat(sent[1]," is best video mode");
  981.             strcpy(sent[2],"for this computer.");
  982.          getanykey(-1,-1);
  983.          }
  984.  
  985.          Performance of example:
  986.              Computer  is  set to highest-possible resolution graphics
  987.          mode with bestvideo();  Then vmode is tested and  sent[1]  is
  988.          assigned a string representing the video mode.  A box pops up
  989.          indicating the best video mode for your computer.
  990.  
  991.          *************************************************************
  992.          void waitforuser(void) - function
  993.  
  994.          Usage: waitforuser()
  995.  
  996.          Description:
  997.             This  simple  procedure stalls the computer until the user
  998.          presses a key or clicks a mouse button. This function  is the
  999.          same as holdon().
  1000.  
  1001.          See Also:
  1002.          pop(), xreadkey(), holdon()
  1003.          Example:
  1004.  
  1005.          #include <magic.h>
  1006.          #include <graphics.h>
  1007.          void main() {
  1008.             magic_setup();
  1009.             bestvideo();
  1010.             triplex();
  1011.             settextstyle(1,3,5);
  1012.             setcolor(LIGHTRED);
  1013.             outtextxy(100,90,"Press any key");
  1014.             waitforuser();
  1015.             cleanup();
  1016.          }
  1017.  
  1018.  
  1019.          Performance of example:
  1020.              This  program  displays  the  words,  "Press   any   key"
  1021.          (sideways)  then waits for the user to press a key or click a
  1022.          mouse button.
  1023.  
  1024.          *************************************************************
  1025.          void waste(void) - function
  1026.  
  1027.          Usage: waste()
  1028.  
  1029.          Description:
  1030.              This  procedure  makes  sure  there  is  nothing  in  the
  1031.          keyboard buffer. If a mouse is installed, it also waits until
  1032.          there  are  no  mouse buttons pressed.  u is assigned 126, an
  1033.          uncommon ASCII character.
  1034.  
  1035.          Considerations:
  1036.  
  1037.          See Also:
  1038.          pop(), xreadkey(), wastemouse()
  1039.  
  1040.          Example:
  1041.          #include <magic.h>
  1042.          #include <stdio.h>
  1043.          #include <conio.h>
  1044.          void main() {
  1045.              magic_setup();
  1046.              printf("Without Waste, keyboard buffer could cause\n");
  1047.              printf("portions of the program to skid past before\n");
  1048.              printf("the user knows what is happening\n");
  1049.              waste();
  1050.              u = getch();
  1051.              clrscr();
  1052.              printf("This is a problem when the user holds a key\n");
  1053.              printf("down too long");
  1054.              waste();
  1055.              u = getch();
  1056.              clrscr();
  1057.          }
  1058.  
  1059.          Performance of example:
  1060.              Three lines appear on the screen. The keyboard buffer  is
  1061.          cleared  out and the program waits until no mouse buttons are
  1062.          pressed.  Then  the  program  waits  for a key to be pressed.
  1063.          Then the screen is cleared and two more lines of text appear.
  1064.          Again,  Waste clears the buffer and waits if a  mouse  button
  1065.          is pressed, and then waits for the user to do something. Then
  1066.          the  screen clears and the program terminates.
  1067.  
  1068.          *************************************************************
  1069.          void xclear(void) - function
  1070.  
  1071.          Usage: xclear()
  1072.  
  1073.          Description:
  1074.             Clears  the  screen  and  sets  the  background  color  to
  1075.          mainback.
  1076.  
  1077.          Considerations:
  1078.             You may not  get  the  effect  expected  when  in  CGA  or
  1079.          Hercules  modes  if  the  selected mainback color is not  one
  1080.          in the current color palette.
  1081.  
  1082.          See Also:
  1083.          bestvideo(), hercvideo(), cgavideo(), etc, mainback  {Magic};
  1084.          setgraphmode(), setcolor(), etc. {Borland}
  1085.  
  1086.          Example:
  1087.          #include <magic.h>
  1088.          #include <graphics.h>
  1089.          main(){
  1090.             magic_setup();
  1091.             vgavideo();
  1092.             rectangle(10,10,20,20);
  1093.             pile("Press any key...");
  1094.             pop(30,30);
  1095.             waitforuser();
  1096.             mainback = MAGENTA;
  1097.             xclear();
  1098.             pile("Press any key...");
  1099.             pop(400,400);
  1100.             waste();
  1101.             waitforuser();
  1102.          }
  1103.  
  1104.          Performance of example:
  1105.              A  small square appears near the upper left corner of the
  1106.          screen along with a box with a line of text.  When a  key  is
  1107.          pressed,  the  screen clears and a box containing one line of
  1108.          text appears near the lower right corner and  the  background
  1109.          color  will  be  magenta.   When  a key is pressed again, the
  1110.          program ends.
  1111.  
  1112.          *************************************************************
  1113.          void xclearg(void) - function
  1114.  
  1115.          Usage: Used internally by the Magic library.  Not recommended
  1116.          for direct usage.
  1117.  
  1118.          Description:
  1119.              Xclearg() is called by xclear to clear screen when  in  a
  1120.          graphics mode.
  1121.  
  1122.          *************************************************************
  1123.          char xcursor[10], ycursor[10] - Global Variables
  1124.  
  1125.          Usage:   Xcursor  is  used  internally  by the Magic library.
  1126.          Direct manipulation is not recommended.
  1127.  
  1128.          Description:
  1129.             These  are  sets  of  10 x and y locations to memorize the
  1130.          position of the cursor in any  of  10  layers  of  text  mode
  1131.          pop-ups.  When  the  screens are restored, the cursor is also
  1132.          returned to the correct locations.
  1133.  
  1134.  
  1135.          *************************************************************
  1136.          void xreadkey(void) - function
  1137.  
  1138.          Usage: /* example */ u = xreadkey()
  1139.  
  1140.          Description:
  1141.             Like  getch(),  this  returns  a  character  to the global
  1142.          unsigned char "u" as soon as a key is  struck.  Additionally,
  1143.          xreadkey,  returns  a character if a mouse button is clicked.
  1144.          If the left button is clicked, u will be set to  13,  if  the
  1145.          right button is clicked, u will be 27.
  1146.  
  1147.          Considerations:
  1148.              Xreadkey()  also  returns  a  value  in  the  global char
  1149.          keydetect.  If a mouse button was pressed, keydetect will  be
  1150.          0. If a standard alphanumeric key was pressed, keydetect will
  1151.          be 1, and if an extended key, keydetect will be set to 2.
  1152.              If  an  extended  key was pressed, the preceding ASCII #0
  1153.          will be ignored and the second character in the sequence will
  1154.          be returned.  For example, when the [F1] key is  pressed,  it
  1155.          puts  #0 and ';' in the keyboard buffer.  Xreadkey() will set
  1156.          u to ';' and keydetect to 2.  The #0 will be discarded.
  1157.  
  1158.          See Also:
  1159.          xreadln(),  waste()  keydetect  {Magic}; getch(), getche(),
  1160.          (and related) {Borland}
  1161.  
  1162.          Example:
  1163.          #include <magic.h>
  1164.          #include <ctype.h>
  1165.          void main() {
  1166.             int i;
  1167.             magic_setup();
  1168.             .
  1169.             .
  1170.             do {
  1171.                xreadkey();
  1172.                u = toupper(u);
  1173.                if (keydetect == 2) { //then it must be a function key
  1174.                   if (u == 'H') up_arrow_was_pressed();
  1175.                   if (u == 'P') down_arrow_was_pressed();
  1176.                }
  1177.             }
  1178.             while (u != 27);
  1179.             .
  1180.             .
  1181.          }
  1182.  
  1183.          Performance of example:
  1184.             Computer waits for user input. If the user presses the  up
  1185.          or     down     arrow     keys,     then    the    fictitious
  1186.          up_arrow_was_pressed() or down_arrow_was_pressed()  functions
  1187.          execute.  This  repeats  until the user presses the [Esc] key
  1188.          (#27).
  1189.  
  1190.          *************************************************************
  1191.          void xreadln(int x, int y, int h) - Function
  1192.  
  1193.          Usage: /* example */ Tempstring := xreadln(x,y,h)
  1194.  
  1195.          Description:
  1196.             You will find this very useful  in  database  applications
  1197.          where  the  user  has  to  fill  in blanks in a form.  Unlike
  1198.          Borland's gets() function this allows you to limit the length
  1199.          of a string the user can type, and it works  in  text  or  in
  1200.          graphics modes.
  1201.             This is similar  to  gotoxy()  combined  with  gets().  Of
  1202.          course,  it  also  works  in  graphics modes. Xreadln() needs
  1203.          three integer variables. The first two are the x and y screen
  1204.          coordinates of the upper left corner of the place  where  the
  1205.          user's  input will be displayed. X is the horizontal position
  1206.          and y is the vertical.  In text video  mode  the  upper  left
  1207.          corner  of  the  screen  is 1,1 and the lower right corner is
  1208.          80,25.  In graphics modes, the upper left corner is  0,0  and
  1209.          the  lower  right  varies.   In  the  CGA  320x200  mode, for
  1210.          instance, the lower right corner would be 319,199.
  1211.             The  last number required, h, is an integer for the number
  1212.          of characters you will allow in the string.  Example: if  you
  1213.          have  a form in which the user is to type a 4-digit number in
  1214.          a space, you call xreadln() with the x and y position of  the
  1215.          start of the space, then 4, to limit the length of the number
  1216.          the  user  may enter to 4 digits. When the user presses [Esc]
  1217.          or [Enter] or clicks a mouse button, xreadln is finished.
  1218.              Xreadln()  returns  a  string in the global unsigned char
  1219.          variable, "answer".
  1220.  
  1221.          Considerations:
  1222.             Xreadln() calls waste() before any other action.   Maximum
  1223.          possible  string length is 75 characters. This procedure uses
  1224.          xreadkey(), so with wise programming you can answer  function
  1225.          key  responses  and  mouse  actions  within  the  typing of a
  1226.          string. This function is useful for reading from the keyboard
  1227.          only, not for reading files.
  1228.             Always  set  textcolor  and  textbackground before calling
  1229.          xreadln, because otherwise, it will  use  the  most  recently
  1230.          assigned colors, which might  be  shadow and border, (default
  1231.          black and black!) after a pop-up box.
  1232.             No automatic centering is available.  Negative coordinates
  1233.          will have unpredictable results - probably a crash!
  1234.  
  1235.          See Also:
  1236.          xreadkey(), waste()  {Magic};  getch(),  gets()  and  related
  1237.          {Borland}
  1238.  
  1239.          Example:
  1240.          #include <magic.h>
  1241.          #include <conio.h>
  1242.          #include <string.h>
  1243.          void main() {
  1244.             char namestring[40];
  1245.             magic_setup();
  1246.             gotoxy(1,10);
  1247.             cprintf("What is your name?");
  1248.             textcolor(WHITE);
  1249.             textbackground(BLUE);
  1250.             xreadln(20,10,40);
  1251.             strcpy(namestr,answer);
  1252.             .
  1253.             .
  1254.          }
  1255.  
  1256.          Performance of example:
  1257.             At  1,10,  "What  is your name?" appears on the screen. At
  1258.          the end of this  line  a  cursor  appears  and  the  user  is
  1259.          expected to type a  name.  The  user's text will be white and
  1260.          the  background  color  will  be  blue.  The user cannot type
  1261.          beyond 40 characters.  When the user presses [Enter] or [Esc]
  1262.          or  clicks  a  mouse button, the program ends.
  1263.  
  1264.          *************************************************************
  1265.          void xreadlng(int x,int y, int h) - function
  1266.  
  1267.          Usage: Used internally by the Magic library.  Direct  use  of
  1268.          this function is not recommended.
  1269.  
  1270.          Description: Called by xreadln() when in a graphics mode.
  1271.  
  1272.          *************************************************************
  1273.          int zx - Global Variable
  1274.  
  1275.          Usage: /* example */ px = zx
  1276.  
  1277.          Description:
  1278.              This  global  int variable declared in MAGIC.H is used to
  1279.          keep track of the maximum horizontal resolution of the screen
  1280.          in the currently selected graphics  mode.   If  the  mode  is
  1281.          changed with cgavideo(), hercvideo(), bestvideo(), etc, zx is
  1282.          also updated.
  1283.  
  1284.          Considerations:
  1285.              Zx is equal to getmaxx(), but faster.
  1286.  
  1287.          See also:
  1288.          zy {Magic}  getmaxx() {Borland}
  1289.  
  1290.          Example:
  1291.          #include <magic.h>
  1292.          #include <graphics.h>
  1293.          void main() {
  1294.             magic_setup();
  1295.             bestvideo();
  1296.             settextjustify(CENTER_TEXT,CENTER_TEXT);
  1297.             outtextxy(zx / 2, zy / 2, "test");
  1298.             waitforuser();
  1299.             cleanup();
  1300.          }
  1301.  
  1302.          Performance of example:
  1303.             A  string  of  text is centered on the graphics screen, no
  1304.          matter what graphics mode the current computer is using.
  1305.          *************************************************************
  1306.          int zy - Global Variable
  1307.  
  1308.          Usage: /* example */ py = zy
  1309.  
  1310.          Description:
  1311.              This  global  int variable declared in MAGIC.H is used to
  1312.          keep track of the maximum vertical resolution of the screen
  1313.          in the currently selected graphics  mode.   If  the  mode  is
  1314.          changed with cgavideo(), hercvideo(), bestvideo(), etc, zy is
  1315.          also updated.
  1316.  
  1317.          Considerations:
  1318.              Zy is equal to getmaxy(), but faster.
  1319.  
  1320.          See also:
  1321.          zx {Magic}  getmaxy() {Borland}
  1322.  
  1323.          Example:
  1324.          #include <magic.h>
  1325.          #include <graphics.h>
  1326.          void main() {
  1327.             magic_setup();
  1328.             bestvideo();
  1329.             settextjustify(CENTER_TEXT,CENTER_TEXT);
  1330.             outtextxy(zx / 2, zy / 2, "test");
  1331.             waitforuser();
  1332.             cleanup();
  1333.          }
  1334.  
  1335.          Performance of example:
  1336.             A  string  of  text is centered on the graphics screen, no
  1337.          matter what graphics mode the current computer is using.
  1338.  
  1339.          *************************************************************
  1340.  
  1341.                      ADVANTAGES OF HAVING THE SOURCE CODE:
  1342.  
  1343.          *  With  the  easy-to-understand  source  code,  you can make
  1344.          modifications to customize it exactly to your needs.
  1345.  
  1346.          * You can learn many 'secret' or hard to find  C  programming
  1347.          techniques.
  1348.  
  1349.          *  Even  though  MAGIC.LIB  takes  little room and runs quite
  1350.          fast,  you  can  strip  down  MAGIC.LIB  for   even   greater
  1351.          efficiency.
  1352.  
  1353.          * You can use portions of the source code as  a  frame  work,
  1354.          changing  this  or  that,  inserting your own code, and build
  1355.          amazing programs of your own invention.
  1356.  
  1357.          *  You  can  easily  build a tight object-oriented version of
  1358.          C-Magic when you have the source code.  This will enable neat
  1359.          tricks like creating several instances of  pop()  or  related
  1360.          functions  in  graphics  modes  and  be  able to have several
  1361.          layers of pop-ups (within RAM limitations, of course)
  1362.  
  1363.          * You can look at  my  approach  to  programming  and  laugh,
  1364.          possibly  commenting  under  your  breath about how you would
  1365.          have done it better.  Then, with  the  source  code  in  your
  1366.          possession, you can do it better!
  1367.  
  1368.          Notice:  This  is shareware. Feel free to copy and distribute
  1369.          the shareware version without modification.  If you  use  any
  1370.          portion   of   the   Magic  library  in  your  programs  then
  1371.          registration is a legal necessity.  Send  $39.95  to  Another
  1372.          Company.  Complete, well-documented easy-to-understand source
  1373.          code  is  available.  For  registration  + registration, send
  1374.          $79.90.
  1375.  
  1376.          Send US funds drawn on a US bank to:
  1377.  
  1378.                                 Another Company
  1379.                                  P.O. Box 298
  1380.                               Applegate, OR 97530
  1381.                                       USA
  1382.                                  503-846-7884
  1383.  
  1384.              Please include $3 for postage  inside  the  USA,  $5  for
  1385.          postage to Canada, or $7 for postage to all other countries.
  1386.  
  1387.              If you require 3.5" disk size, please add $1.00.
  1388.  
  1389.          Even though this seems quite bug-free to me,  it  is  version
  1390.          1.5  and  you may find a surprise or two. I make no warranty.
  1391.          Thanks for trying this software.  Please feel free to  submit
  1392.          bug reports, which I will turn into fixes in later versions.
  1393.  
  1394.                                                           - Jeff -
  1395.                                                      September 2, 1992
  1396.  
  1397.          P.S.
  1398.          If  you require technical assistance, you can try to phone me
  1399.          at 503-846-7884. Best bet is 9-5 weekdays, but I'm not always
  1400.          available.
  1401.  
  1402.          P.S. #2
  1403.          Since you are going to write  some  wonderful  programs,  you
  1404.          might as well start making money with them! You won't have to
  1405.          work  in  an  office doing programming for someone else.  You
  1406.          can write exactly the kind of programs you want to write, and
  1407.          make money at home!
  1408.  
  1409.              The 'secret' is shareware.  Does it work?  You  bet!  You
  1410.          can  easily  have a small success, making some extra spending
  1411.          money each month, or with  some  practice,  you  can  have  a
  1412.          larger  success!
  1413.  
  1414.              ANOTHER COMPANY shows you everything.   Besides  our  own
  1415.          shareware   successes,   including  WRITER'S  DREAM,  BICYCLE
  1416.          TUNE-UP AND REPAIR, MONEY, THE  MULTIMEDIA  WORKSHOP,  BETTER
  1417.          EYESIGHT,  WHAT'S  IN THAT BOX?  and THE UNIVERSAL CONVERTER,
  1418.          we have researched the shareware market, we have  interviewed
  1419.          other  shareware  authors and have learned about all sides of
  1420.          the rapidly expanding shareware business.
  1421.  
  1422.               We show you how  to  write  programs  that  capture  the
  1423.          public's   interest,   how   to   make  sure  your  customers
  1424.          'register', and how to get money by other means through  your
  1425.          shareware.  We  show  you  more. We show you frequency charts
  1426.          indicating which  types  of  programs  sell  best,  we  offer
  1427.          suggestions  for  programs as yet unwritten,  we  talk  about
  1428.          your  on-disk  instruction  manuals,  we even show you how to
  1429.          write user-friendliness into your programs.
  1430.  
  1431.               Can  you  succeed without  SUCCESS WITH SHAREWARE?  Yes!
  1432.          But  why do  it  the  hard  way?  We  have  learned  all  the
  1433.          super-professional   approaches,   the   pitfalls   and   the
  1434.          shortcuts. We'll tell you all about it, and then  instead  of
  1435.          stumbling  around  for  the  first couple of years, you'll be
  1436.          a professional from the start!
  1437.  
  1438.              To get your copy of SUCCESS WITH SHAREWARE! (which is not
  1439.          shareware, itself - only  available  from  Another  Company),
  1440.          send $29.95. Please add $1.00 if you need 3.5" disk size.
  1441.  
  1442.             Please include $3 per order for postage within the USA, $5
  1443.          to Canada or $7 to all other countries.
  1444.  
  1445.          You can order products by writing your order on plain  paper,
  1446.          or  by  printing the included ASCII file called Order.frm, or
  1447.          by phoning 1-503-846-7884, generally weekdays between  9  and
  1448.          5, west coast time.
  1449.  
  1450.