home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 1: Collection A / 17Bit_Collection_A.iso / files / 223.dms / 223.adf / Source / star8.c < prev    next >
C/C++ Source or Header  |  1988-07-25  |  19KB  |  625 lines

  1. /*=========================================================================
  2.   Star8.c -- This module builds and submits a requester in response to
  3.   the user's choice of 'change magnitude' from the OPTIONS  menu
  4.   of the Star Chart program. The requester lets the user modify the 
  5.   maximum magnitudes for stars to be displayed as pluses, or as white
  6.   dots.  
  7.  
  8.   Credits for Star Chart:
  9.        Robert L. Hill of the Orange County, CA. Amiga Friends User Group
  10.                       wrote the original version of StarChart in AmigaBasic
  11.                       The star data and many of the main functions of this
  12.                       version are derived from that program.
  13.  
  14.        Ray R. Larson  wrote the c version 1.0 of StarChart, 'intuitionizing'
  15.                       and enhancing the speed and functions of the original.
  16.  
  17.   Copyright (c) 1986 by Ray R. Larson
  18.   
  19.   This program may be freely distributed and copied, but may not be sold
  20.   without the permission of the author. If you modify or enhance it, 
  21.   please include the above credits (and please send me a copy!).
  22.  
  23. Ray R. Larson
  24. 6425 Central Ave. #304
  25. El Cerrito, CA 94530
  26.  
  27. BitNet  LARSON@UCBCMSA
  28. =========================================================================*/
  29. /*------------Header file for all of the standard stuff----*/ 
  30. /*-------------plus definitions of global structures-------*/
  31. #include "star.h" 
  32.  
  33.  
  34. /**********************************************************************
  35.  *                    Gadget Structure Definitions
  36.  * 
  37.  * The following structures were defined using the Gadget Editor created 
  38.  * by the Programmer's Network.
  39.  * The credits for the Gadget Editor are:
  40.  * 
  41.  *     John Draper    - Initial design, coordination, and integration.
  42.  *     Ray Larson     - Images and Intuitext. 
  43.  *     Brent Southard - Saving and restoring gadgets in binary form.
  44.  *     Dave Milligan  - Gadget Editor Main menu.
  45.  * 
  46.  * 
  47.  **********************************************************************/
  48. /*  Definitions for Gadget ID numbers               */ 
  49. #define  MAGGADGAD   0
  50. #define  WHITEGADGAD   1
  51. #define  CANMAGGAD   2
  52. #define  OKMAGGAD   3
  53.  
  54. /**********************************************************************
  55.  *  Text attribute structures used in rendering IntuiTexts
  56.  **********************************************************************/
  57. extern struct TextAttr TxtAt_Plain,TxtAt_BIU,TxtAt_BU,TxtAt_BI,TxtAt_B,
  58.         TxtAt_IU,TxtAt_I,TxtAt_U;
  59.  
  60.  
  61.  
  62. struct IntuiText Mag_Error_Text = {
  63.    3, 2,     /* FrontPen, BackPen */
  64.    JAM2,       /* DrawMode */
  65.    0, 0,     /* LeftEdge, TopEdge */
  66.    &TxtAt_B, /* ITextFont Pointer */ 
  67.    /* The IText */
  68.    (UBYTE *)"?",
  69.    NULL    /* NextText */
  70.  };
  71.  
  72. /**********************************************************************
  73.  *  Border Definitions for MagniReq requester
  74.  **********************************************************************/
  75.  
  76. SHORT MagniReq_Pairs_1[] = {
  77.   0,     0,   
  78.   257,     0,   
  79.   257,     140,   
  80.   0,     140,   
  81.   0,     0    
  82. };
  83. struct Border MagniReq_bord_1 = {
  84.   1,  1,       /* LeftEdge, TopEdge */
  85.   7,  1,  JAM2,  /* FrontPen, BackPen, DrawMode*/
  86.   5,             /* Count of XY pairs */  
  87.   (SHORT *)&MagniReq_Pairs_1, /* XY pairs */
  88.   NULL           /* Next Border */
  89. };
  90.  
  91. SHORT MagniReq_Pairs_2[] = {
  92.   0,     0,   
  93.   251,     0,   
  94.   251,     137,   
  95.   0,     137,   
  96.   0,     0    
  97. };
  98. struct Border MagniReq_bord_2 = {
  99.   3,  3,       /* LeftEdge, TopEdge */
  100.   1,  7,  JAM2,  /* FrontPen, BackPen, DrawMode*/
  101.   5,             /* Count of XY pairs */  
  102.   (SHORT *)&MagniReq_Pairs_2, /* XY pairs */
  103.   &MagniReq_bord_1           /* Next Border */
  104. };
  105.  
  106.  
  107.  
  108. /**********************************************************************
  109.  *  Border Definitions for okmag gadget
  110.  **********************************************************************/
  111.  
  112. SHORT okmag_Pairs_2[] = {
  113.   0,     0,   
  114.   88,     0,   
  115.   88,     17,   
  116.   0,     17,   
  117.   0,     0    
  118. };
  119. struct Border okmag_bord_2 = {
  120.   -1,  -1,       /* LeftEdge, TopEdge */
  121.   1,  7,  JAM2,  /* FrontPen, BackPen, DrawMode*/
  122.   5,             /* Count of XY pairs */  
  123.   (SHORT *)&okmag_Pairs_2, /* XY pairs */
  124.   NULL           /* Next Border */
  125. };
  126.  
  127.  
  128. /**********************************************************************
  129.  *  IntuiTexts for the okmag gadget.
  130.  **********************************************************************/
  131.  
  132. struct IntuiText okmag_Text_0 = {
  133.    7, 0,     /* FrontPen, BackPen */
  134.    JAM2,       /* DrawMode */
  135.    12, 4,     /* LeftEdge, TopEdge */
  136.    &TxtAt_B, /* ITextFont Pointer */ 
  137.    /* The IText */
  138.    (UBYTE *)"   OK   ",
  139.    NULL
  140.  };
  141.  
  142.  
  143.  
  144. /**********************************************************************
  145.  *  Gadget Structure definition for the okmag gadget.
  146.  **********************************************************************/
  147.  
  148. struct Gadget okmag = {
  149.   NULL,     /* NextGadget pointer */
  150.   152, 116,    /* LeftEdge, TopEdge  */
  151.   88, 17,    /* Width, Height      */
  152.   /* Gadget Flags */
  153.   GADGHCOMP,
  154.   /* Activation Flags */
  155.   RELVERIFY | GADGIMMEDIATE,
  156.   /* GadgetType */
  157.   BOOLGADGET | REQGADGET,
  158.   (APTR)&okmag_bord_2,   /*  GadgetRender */
  159.   NULL,    /* SelectRender */
  160.    &okmag_Text_0,  /* GadgetText */
  161.   0x0,    /* MutualExclude */
  162.   NULL,   /* SpecialInfo */
  163.   OKMAGGAD,    /* GadgetID         */
  164.   0x1     /* UserData Pointer */
  165. };
  166.  
  167.  
  168. /**********************************************************************
  169.  *  Border Definitions for canmag gadget
  170.  **********************************************************************/
  171.  
  172. SHORT canmag_Pairs_3[] = {
  173.   0,     0,   
  174.   88,     0,   
  175.   88,     17,   
  176.   0,     17,   
  177.   0,     0    
  178. };
  179. struct Border canmag_bord_3 = {
  180.   -1,  -1,       /* LeftEdge, TopEdge */
  181.   1,  7,  JAM2,  /* FrontPen, BackPen, DrawMode*/
  182.   5,             /* Count of XY pairs */  
  183.   (SHORT *)&canmag_Pairs_3, /* XY pairs */
  184.   NULL           /* Next Border */
  185. };
  186.  
  187.  
  188. /**********************************************************************
  189.  *  IntuiTexts for the canmag gadget.
  190.  **********************************************************************/
  191.  
  192. struct IntuiText canmag_Text_0 = {
  193.    7, 0,     /* FrontPen, BackPen */
  194.    JAM2,       /* DrawMode */
  195.    10, 4,     /* LeftEdge, TopEdge */
  196.    &TxtAt_B, /* ITextFont Pointer */ 
  197.    /* The IText */
  198.    (UBYTE *)" CANCEL ",
  199.    NULL
  200.  };
  201.  
  202.  
  203.  
  204. /**********************************************************************
  205.  *  Gadget Structure definition for the canmag gadget.
  206.  **********************************************************************/
  207.  
  208. struct Gadget canmag = {
  209.  &okmag,     /* NextGadget pointer */
  210.   29, 116,    /* LeftEdge, TopEdge  */
  211.   88, 17,    /* Width, Height      */
  212.   /* Gadget Flags */
  213.   GADGHCOMP,
  214.   /* Activation Flags */
  215.   RELVERIFY | GADGIMMEDIATE | ENDGADGET,
  216.   /* GadgetType */
  217.   BOOLGADGET | REQGADGET,
  218.   (APTR)&canmag_bord_3,   /*  GadgetRender */
  219.   NULL,    /* SelectRender */
  220.    &canmag_Text_0,  /* GadgetText */
  221.   0x0,    /* MutualExclude */
  222.   NULL,   /* SpecialInfo */
  223.   CANMAGGAD,    /* GadgetID         */
  224.   0x1     /* UserData Pointer */
  225. };
  226.  
  227.  
  228. /**********************************************************************
  229.  *  Border Definitions for whitegad gadget
  230.  **********************************************************************/
  231.  
  232. SHORT whitegad_Pairs_4[] = {
  233.   0,     0,   
  234.   74,     0,   
  235.   74,     10,   
  236.   0,     10,   
  237.   0,     0    
  238. };
  239. struct Border whitegad_bord_4 = {
  240.   -1,  -1,       /* LeftEdge, TopEdge */
  241.   1,  7,  JAM2,  /* FrontPen, BackPen, DrawMode*/
  242.   5,             /* Count of XY pairs */  
  243.   (SHORT *)&whitegad_Pairs_4, /* XY pairs */
  244.   NULL           /* Next Border */
  245. };
  246.  
  247.  
  248. /**********************************************************************
  249.  *  IntuiTexts for the whitegad gadget.
  250.  **********************************************************************/
  251.  
  252. struct IntuiText whitegad_Text_2 = {
  253.    0, 2,     /* FrontPen, BackPen */
  254.    JAM2,       /* DrawMode */
  255.    -37, 11,     /* LeftEdge, TopEdge */
  256.    &TxtAt_I, /* ITextFont Pointer */ 
  257.    /* The IText */
  258.    (UBYTE *)"(range 0.0 - 10.0)",
  259.    NULL
  260.  };
  261.  
  262.  
  263. struct IntuiText whitegad_Text_1 = {
  264.    1, 2,     /* FrontPen, BackPen */
  265.    JAM2,       /* DrawMode */
  266.    -56, -10,     /* LeftEdge, TopEdge */
  267.    &TxtAt_B, /* ITextFont Pointer */ 
  268.    /* The IText */
  269.    (UBYTE *)"displayed as a white dot:",
  270.    &whitegad_Text_2    /* NextText */
  271.  };
  272.  
  273.  
  274. struct IntuiText whitegad_Text_0 = {
  275.    1, 2,     /* FrontPen, BackPen */
  276.    JAM2,       /* DrawMode */
  277.    -63, -19,     /* LeftEdge, TopEdge */
  278.    &TxtAt_B, /* ITextFont Pointer */ 
  279.    /* The IText */
  280.    (UBYTE *)"Maximum Magnitude for stars",
  281.    &whitegad_Text_1    /* NextText */
  282.  };
  283.  
  284.  
  285.  
  286. /**********************************************************************
  287.  *  String information for the whitegad string gadget.
  288.  **********************************************************************/
  289.  
  290. UBYTE WhiteMagBuf[12];
  291. UBYTE whitegad_ubuf_1[12];
  292.  
  293. struct StringInfo WhiteMagTxt = {
  294.   WhiteMagBuf, whitegad_ubuf_1, /* Buffer, UndoBuffer  */
  295.   0, 11, 0,  /* BufferPos, MaxChars, DispPos   */
  296.   0, 0,      /* UndoPos, NumChars              */
  297.   0, 86, 84,  /* DispCount, CLeft, CTop         */
  298.   0x0, 0,   /* LayerPtr, LongInt              */
  299.   0x0        /* AltKeyMap                      */
  300. };
  301.  
  302.  
  303. /**********************************************************************
  304.  *  Gadget Structure definition for the whitegad gadget.
  305.  **********************************************************************/
  306.  
  307. struct Gadget whitegad = {
  308.  &canmag,     /* NextGadget pointer */
  309.   86, 84,    /* LeftEdge, TopEdge  */
  310.   74, 10,    /* Width, Height      */
  311.   /* Gadget Flags */
  312.   GADGHCOMP,
  313.   /* Activation Flags */
  314.   RELVERIFY | GADGIMMEDIATE | STRINGCENTER,
  315.   /* GadgetType */
  316.   STRGADGET | REQGADGET,
  317.   (APTR)&whitegad_bord_4,   /*  GadgetRender */
  318.   NULL,    /* SelectRender */
  319.    &whitegad_Text_0,  /* GadgetText */
  320.   0x0,    /* MutualExclude */
  321.   (APTR)&WhiteMagTxt,   /* SpecialInfo */
  322.   WHITEGADGAD,    /* GadgetID         */
  323.   0x1     /* UserData Pointer */
  324. };
  325.  
  326.  
  327. /**********************************************************************
  328.  *  Border Definitions for maggad gadget
  329.  **********************************************************************/
  330.  
  331. SHORT maggad_Pairs_5[] = {
  332.   0,     0,   
  333.   73,     0,   
  334.   73,     9,   
  335.   0,     9,   
  336.   0,     0    
  337. };
  338. struct Border maggad_bord_5 = {
  339.   -1,  -1,       /* LeftEdge, TopEdge */
  340.   1,  7,  JAM2,  /* FrontPen, BackPen, DrawMode*/
  341.   5,             /* Count of XY pairs */  
  342.   (SHORT *)&maggad_Pairs_5, /* XY pairs */
  343.   NULL           /* Next Border */
  344. };
  345.  
  346.  
  347. /**********************************************************************
  348.  *  IntuiTexts for the maggad gadget.
  349.  **********************************************************************/
  350.  
  351. struct IntuiText maggad_Text_2 = {
  352.    0, 2,     /* FrontPen, BackPen */
  353.    JAM2,       /* DrawMode */
  354.    -39, 10,     /* LeftEdge, TopEdge */
  355.    &TxtAt_I, /* ITextFont Pointer */ 
  356.    /* The IText */
  357.    (UBYTE *)"(range 0.0 - 10.0)",
  358.    NULL
  359.  };
  360.  
  361.  
  362. struct IntuiText maggad_Text_1 = {
  363.    1, 2,     /* FrontPen, BackPen */
  364.    JAM2,       /* DrawMode */
  365.    -56, -10,     /* LeftEdge, TopEdge */
  366.    &TxtAt_B, /* ITextFont Pointer */ 
  367.    /* The IText */
  368.    (UBYTE *)"displayed as a plus sign:",
  369.    &maggad_Text_2    /* NextText */
  370.  };
  371.  
  372.  
  373. struct IntuiText maggad_Text_0 = {
  374.    1, 2,     /* FrontPen, BackPen */
  375.    JAM2,       /* DrawMode */
  376.    -64, -19,     /* LeftEdge, TopEdge */
  377.    &TxtAt_B, /* ITextFont Pointer */ 
  378.    /* The IText */
  379.    (UBYTE *)"Maximum Magnitude for stars",
  380.    &maggad_Text_1    /* NextText */
  381.  };
  382.  
  383.  
  384.  
  385. /**********************************************************************
  386.  *  String information for the maggad string gadget.
  387.  **********************************************************************/
  388.  
  389. UBYTE PlusMagBuf[12];
  390. UBYTE maggad_ubuf_2[12];
  391.  
  392. struct StringInfo PlusMagTxt = {
  393.   PlusMagBuf, maggad_ubuf_2, /* Buffer, UndoBuffer  */
  394.   0, 11, 0,  /* BufferPos, MaxChars, DispPos   */
  395.   0, 0,      /* UndoPos, NumChars              */
  396.   0, 87, 39,  /* DispCount, CLeft, CTop         */
  397.   0x0, 0,   /* LayerPtr, LongInt              */
  398.   0x0        /* AltKeyMap                      */
  399. };
  400.  
  401.  
  402. /**********************************************************************
  403.  *  Gadget Structure definition for the maggad gadget.
  404.  **********************************************************************/
  405.  
  406. struct Gadget maggad = {
  407.  &whitegad,     /* NextGadget pointer */
  408.   87, 39,    /* LeftEdge, TopEdge  */
  409.   73, 9,    /* Width, Height      */
  410.   /* Gadget Flags */
  411.   GADGHCOMP,
  412.   /* Activation Flags */
  413.   RELVERIFY | GADGIMMEDIATE | STRINGCENTER,
  414.   /* GadgetType */
  415.   STRGADGET | REQGADGET,
  416.   (APTR)&maggad_bord_5,   /*  GadgetRender */
  417.   NULL,    /* SelectRender */
  418.    &maggad_Text_0,  /* GadgetText */
  419.   0x0,    /* MutualExclude */
  420.   (APTR)&PlusMagTxt,   /* SpecialInfo */
  421.   MAGGADGAD,    /* GadgetID         */
  422.   0x1     /* UserData Pointer */
  423. };
  424.  
  425. /****************************************************************************
  426.  *  Global Structures 
  427.  ***************************************************************************/
  428.  
  429. /* the newwindow structure used in GT */
  430. extern struct NewWindow nw;
  431. extern struct Window *w;
  432. extern FLOAT MaxPlus, MaxWhite;
  433.  
  434. /****************************************************************************
  435.  * External function definitions
  436.  ***************************************************************************/
  437. extern struct IntuiMessage *GetMsg();
  438. extern double atof();
  439.  
  440. /****************************************************************************
  441.  * Requester structure and global pointer to it's gadget list.
  442.  ***************************************************************************/
  443. struct Requester MagniRequester;
  444.  
  445. /****************************************************************************
  446.  *               The Code part of the Getmags module.
  447.  ***************************************************************************/
  448. GetMags()
  449. {
  450.   BOOL cancelchosen;
  451.   LONG iflags;
  452.   struct RastPort *reqrp;
  453.  
  454.  
  455.   /* fix the IDCMP flags to report requester set and clear */
  456.   iflags = nw.IDCMPFlags;
  457.   iflags |= REQCLEAR;
  458.   ModifyIDCMP(w,iflags);
  459.   
  460.  
  461.       /* initialize the magnitude requester */ 
  462.       InitMagniReq();
  463.  
  464.       /* Put up the requester  */ 
  465.       Request(&MagniRequester,w);
  466.       
  467.       reqrp = MagniRequester.ReqLayer->rp;
  468.  
  469.       /* let the user fill in the parameters and wait for a cancel or ok. */  
  470.       cancelchosen = WaitMagniReq(reqrp);
  471.       
  472.       /* if the user cancelled, just return -- otherwise set magnitudes   */
  473.       /* and redisplay the star chart.                            */
  474.       if (cancelchosen) return(0);
  475.       
  476.       MaxPlus = (FLOAT)atof(PlusMagBuf);
  477.       MaxWhite = (FLOAT)atof(WhiteMagBuf);
  478.       ReDisplay();
  479. } /* GetMags */
  480.  
  481. /*
  482.  *  Init the magnitude requester
  483.  */
  484. InitMagniReq()
  485.   struct RastPort *reqrp;
  486.   
  487.   InitRequester(&MagniRequester);
  488.   MagniRequester.LeftEdge  = 110;
  489.   MagniRequester.TopEdge   = 12;
  490.   MagniRequester.Width     = 260;
  491.   MagniRequester.Height    = 145;
  492.   MagniRequester.ReqGadget = &maggad;
  493.   MagniRequester.ReqText   = NULL;
  494.   MagniRequester.BackFill  = 2;
  495.   MagniRequester.Flags     = 0;
  496.   MagniRequester.ReqBorder = &MagniReq_bord_2;
  497.   
  498.   sprintf(PlusMagBuf,"%6.2f",MaxPlus);
  499.   PlusMagTxt.NumChars = (LONG)strlen(PlusMagBuf);
  500.   *(maggad_ubuf_2) = '\0';
  501.   sprintf(WhiteMagBuf,"%6.2f",MaxWhite);
  502.   WhiteMagTxt.NumChars = (LONG)strlen(WhiteMagBuf);
  503.   *(whitegad_ubuf_1) = '\0';
  504. }
  505.  
  506.   
  507. /****************************************************************************
  508.  *  WaitMagniReq - permit user to change the values in the requester gadgets
  509.  *                 and check the values they install until either the 
  510.  *                 CANCEL gadget is clicked or the OK gadget is clicked AND
  511.  *                 there are no outstanding input errors
  512.  ***************************************************************************/
  513. BOOL WaitMagniReq(reqrp)
  514. struct RastPort *reqrp;
  515. {
  516.   ULONG  class = GADGETDOWN;
  517.   struct IntuiMessage *message;
  518.   struct Gadget *gadget;
  519.   BOOL cancelflag = FALSE;
  520.   LONG  errorflag = 0L, checkmag();
  521.  
  522.   while (class != REQCLEAR)
  523.     {
  524.     if ((message=(struct IntuiMessage *) GetMsg(w->UserPort)) == 0L)
  525.       {
  526.       Wait(1L<<w->UserPort->mp_SigBit);
  527.       continue;
  528.       }
  529.  
  530.     class  = message->Class;
  531.     gadget = (struct Gadget *) message->IAddress;
  532.     ReplyMsg(message);
  533.     switch (class)
  534.       {
  535.       case GADGETDOWN:
  536.                       break;
  537.  
  538.       case GADGETUP: 
  539.          switch (gadget->GadgetID)
  540.         {
  541.         case  MAGGADGAD: 
  542.                          errorflag = checkmag(reqrp,gadget,errorflag,class);
  543.              break;   
  544.              
  545.         case  WHITEGADGAD: 
  546.                          errorflag = checkmag(reqrp,gadget,errorflag,class);
  547.              break;   
  548.         
  549.  
  550.         case  CANMAGGAD : 
  551.                      cancelflag = TRUE;
  552.                              break; 
  553.  
  554.                    case  OKMAGGAD  :
  555.                   if (errorflag == 0) 
  556.                      EndRequest(&MagniRequester,w);
  557.                  else DisplayBeep(w->WScreen);    
  558.                  break;
  559.  
  560.              } /* end of GADGETUP switch */
  561.  
  562.         } /* end of CLASS switch */
  563.     }/* end of while loop */
  564.     
  565.  
  566. return(cancelflag);
  567.        
  568. } /* WaitMagniReq */
  569.    
  570. /****************************************************************************
  571.  *  checkmag - verify that the values returned in the string gadgets are
  572.  *              in the appropriate range for the parameter.
  573.   ***************************************************************************/
  574. LONG checkmag(reqrp,checkgad,errorflag,class)
  575. struct RastPort *reqrp;
  576. struct Gadget *checkgad;
  577. LONG errorflag;
  578. ULONG class;
  579. {
  580.   struct StringInfo *si;
  581.   BOOL  inputerror = FALSE;
  582.   LONG  checknum, pendingerror;
  583.   UBYTE *c;
  584.   FLOAT temp;
  585.  
  586.    if (checkgad == NULL) return(errorflag);
  587.    pendingerror = errorflag;
  588.  
  589.    si = (struct StringInfo *)checkgad->SpecialInfo;
  590.    if (si == NULL) return(errorflag);
  591.    
  592.    for(c=si->Buffer; *c; c++)
  593.       { if ((isdigit(*c)) || (*c == '.') || (isspace(*c))) ;
  594.         else inputerror == TRUE;
  595.       }
  596.    
  597.    if (inputerror == FALSE)
  598.       temp = (FLOAT)atof(si->Buffer);
  599.  
  600.    if ((temp < 0.0) || (temp > 10.0))
  601.       inputerror == TRUE;
  602.  
  603.  
  604.    if (inputerror == TRUE) /* put a "?" next to the gadget */
  605.       { 
  606.         errorflag |= (1L << checkgad->GadgetID);
  607.         DisplayBeep(w->WScreen);
  608.         PrintIText(reqrp,&Mag_Error_Text,
  609.           (LONG)(checkgad->LeftEdge - 10),(LONG)checkgad->TopEdge);
  610.       }
  611.  
  612.     if ((pendingerror != errorflag) && (inputerror == FALSE))
  613.       { /* user must have fixed an error, so turn off the ? */
  614.         pendingerror = errorflag;
  615.         Mag_Error_Text.FrontPen = 2;
  616.         PrintIText(reqrp,&Mag_Error_Text,
  617.           (LONG)(checkgad->LeftEdge - 10),(LONG)checkgad->TopEdge);
  618.         Mag_Error_Text.FrontPen = 3;
  619.       }
  620. return(errorflag);
  621.        
  622. } /* end of checkmag */
  623.  
  624.