home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Applications / UIFlow 1.0.1 / UIFlow Source / CFDFront / TModalDialog.cp < prev    next >
Encoding:
Text File  |  1992-02-21  |  19.9 KB  |  530 lines  |  [TEXT/MPS ]

  1. #pragma segment MenuOption
  2. //*********************************************************************************
  3. //    Modal Dialog Boxes used by the menus
  4. //    these are created by the modeless dialogs
  5. //*********************************************************************************
  6. //------------------------------------------------------------------------------------------
  7. //    TBoundryRadius - GetParams
  8. //------------------------------------------------------------------------------------------
  9. void TBoundryRadius::GetParams(void)
  10.     {
  11.     float                radius;
  12.     TWindow     * aWindow;                                                                            // window for this dialog
  13.     TEditText    * theRadius;                                                                            // radius of the inner boundry
  14.     IDType            dismisser;
  15.     Str255            pRadius;
  16.     StringPtr        pText;
  17.     char         *    itsRadius, iRadius[20];
  18.     
  19.     aWindow = this->GetWindow();                                                                // get the window
  20.     theRadius = (TEditText *) aWindow->FindSubView('RD01');                    // get the text window
  21.  
  22.     this->fDefaultItem = 'OKOK';                                                                    // set the default items
  23.     this->fCancelItem = 'CNCL';
  24.     radius = ((TCFDFrontDocument *) fDocument)->GetRadiusOpts();             // store the data
  25.     sprintf(iRadius,"%f",radius);                                                                // convert to string
  26.     pText = c2pstr(iRadius);                                                                        // convert to pascal
  27.     theRadius->SetText(pText,true);                                                            // display the value
  28.     
  29.     dismisser = this->PoseModally();                                                            // pose the question
  30.     
  31.     if (dismisser == kOK)                                                                            // ok button
  32.         {
  33.         theRadius->GetText(pRadius);                                                            // get the value
  34.         itsRadius = p2cstr((StringPtr) pRadius);                                            // convert to a c string
  35.         radius = atof(itsRadius);                                                                    // convert to a number
  36.         ((TCFDFrontDocument *) fDocument)->SetRadiusOpts(radius);             // store the data
  37.         }
  38.     
  39.     aWindow->Close();                                                                                // close the window
  40.     return;
  41.     }
  42.     
  43. //------------------------------------------------------------------------------------------
  44. //    TPremix - GetParams
  45. //------------------------------------------------------------------------------------------
  46. void TPremix::GetParams(void)
  47.     {
  48.     float                breakup, p5, p8, p9;
  49.     short            cmp, index;
  50.     extended        p;
  51.     TWindow     * aWindow;                                                                            // window for this dialog
  52.     TEditText    *    b, * pr, * pr5, * pr8, *pr9;
  53.     TRadio        * c[2];
  54.     IDType            dismisser;
  55.     Str255            pPran;
  56.     StringPtr        pText;
  57.     char         *    itsPran, iPran[20];
  58.     
  59.     aWindow = this->GetWindow();                                                                // get the window
  60.     HLock((Handle) this);
  61.     ((TCFDFrontDocument *) fDocument)->GetPremixOpts(&breakup,&cmp,&p,&p8,&p9,&p5);// store the data
  62.     HUnlock((Handle) this);
  63.  
  64.     this->fDefaultItem = 'OKOK';                                                                    // set the default items
  65.     this->fCancelItem = 'CNCL';
  66.  
  67.     b = (TEditText *) aWindow->FindSubView('PR01');                                // get the edit box
  68.     pr = (TEditText *) aWindow->FindSubView('PR05');                                // get the edit box
  69.     pr5 = (TEditText *) aWindow->FindSubView('PR04');                            // get the edit box
  70.     pr8 = (TEditText *) aWindow->FindSubView('PR02');                            // get the edit box
  71.     pr9 = (TEditText *) aWindow->FindSubView('PR03');                            // get the edit box
  72.     c[0] = (TRadio *) aWindow->FindSubView('icmp');                                    // get methane button
  73.     c[1] = (TRadio *) aWindow->FindSubView('cmpr');                                // get town gas button
  74.     
  75.     sprintf(iPran,"%f",breakup);                                                                // convert to string
  76.     pText = c2pstr(iPran);                                                                            // convert to pascal
  77.     b->SetText(pText,true);                                                                        // display the value
  78.     
  79.     sprintf(iPran,"%f",p8);                                                                        // convert to string
  80.     pText = c2pstr(iPran);                                                                            // convert to pascal
  81.     pr8->SetText(pText,true);                                                                    // display the value
  82.     
  83.     sprintf(iPran,"%f",p9);                                                                        // convert to string
  84.     pText = c2pstr(iPran);                                                                            // convert to pascal
  85.     pr9->SetText(pText,true);                                                                    // display the value
  86.     
  87.     sprintf(iPran,"%f",p5);                                                                        // convert to string
  88.     pText = c2pstr(iPran);                                                                            // convert to pascal
  89.     pr5->SetText(pText,true);                                                                    // display the value
  90.     
  91.     sprintf(iPran,"%e",p);                                                                            // convert to string
  92.     pText = c2pstr(iPran);                                                                            // convert to pascal
  93.     pr->SetText(pText,true);                                                                        // display the value
  94.     
  95.     c[0]->SetState(false,false);                                                                    // turn all off
  96.     c[1]->SetState(false,false);                                                                    // turn all off
  97.     c[cmp]->SetState(true,true);                                                                // turn correct one on
  98.  
  99.     dismisser = this->PoseModally();                                                            // pose the question
  100.         
  101.     if (dismisser == kOK)                                                                            // ok button
  102.         {
  103.         b->GetText(pPran);                                                                            // get the text
  104.         itsPran = p2cstr((StringPtr) pPran);                                                // convert to c
  105.         breakup = atof(itsPran);                                                                    // convert to float
  106.             
  107.         pr8->GetText(pPran);                                                                        // get the text
  108.         itsPran = p2cstr((StringPtr) pPran);                                                // convert to c
  109.         p8 = atof(itsPran);                                                                            // convert to float
  110.             
  111.         pr9->GetText(pPran);                                                                        // get the text
  112.         itsPran = p2cstr((StringPtr) pPran);                                                // convert to c
  113.         p9 = atof(itsPran);                                                                            // convert to float
  114.             
  115.         pr5->GetText(pPran);                                                                        // get the text
  116.         itsPran = p2cstr((StringPtr) pPran);                                                // convert to c
  117.         p5 = atof(itsPran);                                                                            // convert to float
  118.             
  119.         pr->GetText(pPran);                                                                            // get the text
  120.         itsPran = p2cstr((StringPtr) pPran);                                                // convert to c
  121.         p = atof(itsPran);                                                                                // convert to float
  122.             
  123.         for (index = 0; index < 2; index++)
  124.             {
  125.             if (c[index]->IsOn())
  126.                 cmp = index;
  127.             }
  128.             
  129.         ((TCFDFrontDocument *) fDocument)->SetPremixOpts(breakup,cmp,p,p8,p9,p5);// store the data
  130.         }
  131.     
  132.     aWindow->Close();                                                                                // close the window
  133.     return;
  134.     }
  135.     
  136. //------------------------------------------------------------------------------------------
  137. //    TDiffusion - GetParams
  138. //------------------------------------------------------------------------------------------
  139. void TDiffusion::GetParams(void)
  140.     {
  141.     float                p8, p10,tA,tF;
  142.     extended        p;
  143.     short            fuel, cmp, index;
  144.     TWindow     * aWindow;                                                                            // window for this dialog
  145.     TEditText    * pr8, *pr10,  * pr, * tempA, * tempF;
  146.     TRadio        *    f[3], * c[2];
  147.     IDType            dismisser;
  148.     Str255            pPran;
  149.     StringPtr        pText;
  150.     char         *    itsPran, iPran[20];
  151.     
  152.     aWindow = this->GetWindow();                                                                // get the window
  153.     HLock((Handle) this);
  154.     ((TCFDFrontDocument *) fDocument)->GetDiffusionOpts(&fuel,&cmp,&p,&p8,&p10,&tA,&tF);// store the data
  155.     HUnlock((Handle) this);
  156.  
  157.     this->fDefaultItem = 'OKOK';                                                                    // set the default items
  158.     this->fCancelItem = 'CNCL';
  159.  
  160. //    get reference to each data object in the dialog box
  161.     f[0] = (TRadio *) aWindow->FindSubView('prop');                                    // get propane button
  162.     f[1] = (TRadio *) aWindow->FindSubView('meth');                                    // get methane button
  163.     f[2] = (TRadio *) aWindow->FindSubView('town');                                    // get town gas button
  164.     c[0] = (TRadio *) aWindow->FindSubView('icmp');                                    // get methane button
  165.     c[1] = (TRadio *) aWindow->FindSubView('cmpr');                                // get town gas button
  166.     pr8 = (TEditText *) aWindow->FindSubView('PR01');                            // get the edit box
  167.     pr10 = (TEditText *) aWindow->FindSubView('PR02');                            // get the edit box
  168.     tempA = (TEditText *) aWindow->FindSubView('PR04');                        // get the edit box
  169.     tempF = (TEditText *) aWindow->FindSubView('PR03');                        // get the edit box
  170.     pr = (TEditText *) aWindow->FindSubView('PR05');                                // get the edit box
  171.     
  172. //    set the initial values for the data 
  173.     sprintf(iPran,"%f",p8);                                                                        // convert to string
  174.     pText = c2pstr(iPran);                                                                            // convert to pascal
  175.     pr8->SetText(pText,true);                                                                    // display the value
  176.     
  177.     sprintf(iPran,"%f",p10);                                                                        // convert to string
  178.     pText = c2pstr(iPran);                                                                            // convert to pascal
  179.     pr10->SetText(pText,true);                                                                    // display the value
  180.     
  181.     sprintf(iPran,"%.2f",tA);                                                                        // convert to string
  182.     pText = c2pstr(iPran);                                                                            // convert to pascal
  183.     tempA->SetText(pText,true);                                                                // display the value
  184.     
  185.     sprintf(iPran,"%.2f",tF);                                                                        // convert to string
  186.     pText = c2pstr(iPran);                                                                            // convert to pascal
  187.     tempF->SetText(pText,true);                                                                // display the value
  188.     
  189.     sprintf(iPran,"%e",p);                                                                            // convert to string
  190.     pText = c2pstr(iPran);                                                                            // convert to pascal
  191.     pr->SetText(pText,true);                                                                        // display the value
  192.     
  193.     f[0]->SetState(false,false);                                                                    // turn all off
  194.     f[1]->SetState(false,false);                                                                    // turn all off
  195.     f[2]->SetState(false,false);                                                                    // turn all off
  196.     f[fuel]->SetState(true,true);                                                                // turn correct one on
  197.  
  198.     c[0]->SetState(false,false);                                                                    // turn all off
  199.     c[1]->SetState(false,false);                                                                    // turn all off
  200.     c[cmp]->SetState(true,true);                                                                // turn correct one on
  201.  
  202. //    get the new values    
  203.     dismisser = this->PoseModally();                                                            // pose the question
  204.         
  205.     if (dismisser == kOK)                                                                            // ok button
  206.         {
  207. //    store the new values to the document
  208.         pr8->GetText(pPran);                                                                        // get the text
  209.         itsPran = p2cstr((StringPtr) pPran);                                                // convert to c
  210.         p8 = atof(itsPran);                                                                            // convert to float
  211.             
  212.         pr10->GetText(pPran);                                                                        // get the text
  213.         itsPran = p2cstr((StringPtr) pPran);                                                // convert to c
  214.         p10 = atof(itsPran);                                                                            // convert to float
  215.             
  216.         tempF->GetText(pPran);                                                                    // get the text
  217.         itsPran = p2cstr((StringPtr) pPran);                                                // convert to c
  218.         tF = atof(itsPran);                                                                            // convert to float
  219.             
  220.         tempA->GetText(pPran);                                                                    // get the text
  221.         itsPran = p2cstr((StringPtr) pPran);                                                // convert to c
  222.         tA = atof(itsPran);                                                                            // convert to float
  223.             
  224.         pr->GetText(pPran);                                                                            // get the text
  225.         itsPran = p2cstr((StringPtr) pPran);                                                // convert to c
  226.         p = atof(itsPran);                                                                                // convert to float
  227.             
  228.         for (index = 0; index < 3; index++)
  229.             {
  230.             if (f[index]->IsOn())                                                                        // is it on?
  231.                 fuel = index;
  232.             if (index < 2)
  233.                 if (c[index]->IsOn())
  234.                     cmp = index;
  235.             }
  236.         ((TCFDFrontDocument *) fDocument)->SetDiffusionOpts(fuel,cmp,p,p8,p10,tA,tF);// store the data
  237.         }
  238.     
  239.     aWindow->Close();                                                                                // close the window
  240.     return;
  241.     }
  242.     
  243. //------------------------------------------------------------------------------------------
  244. //    TTurbulence - GetParams
  245. //------------------------------------------------------------------------------------------
  246. void TTurbulence::GetParams(void)
  247.     {
  248.     float                p6, p7;
  249.     TWindow     * aWindow;                                                                            // window for this dialog
  250.     TEditText    * pr6, *pr7;
  251.     IDType            dismisser;
  252.     Str255            pPran;
  253.     StringPtr        pText;
  254.     char         *    itsPran, iPran[20];
  255.     
  256.     aWindow = this->GetWindow();                                                                // get the window
  257.     HLock((Handle) this);
  258.     ((TCFDFrontDocument *) fDocument)->GetTurbulenceOpts(&p6,&p7);    // store the data
  259.     HUnlock((Handle) this);
  260.  
  261.     this->fDefaultItem = 'OKOK';                                                                    // set the default items
  262.     this->fCancelItem = 'CNCL';
  263.  
  264. //    get reference to each data object in the dialog box
  265.     pr6 = (TEditText *) aWindow->FindSubView('PR01');                            // get the edit box
  266.     pr7 = (TEditText *) aWindow->FindSubView('PR02');                            // get the edit box
  267.     
  268. //    set the initial values for the data 
  269.     sprintf(iPran,"%f",p6);                                                                        // convert to string
  270.     pText = c2pstr(iPran);                                                                            // convert to pascal
  271.     pr6->SetText(pText,true);                                                                    // display the value
  272.     
  273.     sprintf(iPran,"%f",p7);                                                                        // convert to string
  274.     pText = c2pstr(iPran);                                                                            // convert to pascal
  275.     pr7->SetText(pText,true);                                                                    // display the value
  276.     
  277. //    get the new values    
  278.     dismisser = this->PoseModally();                                                            // pose the question
  279.         
  280.     if (dismisser == kOK)                                                                            // ok button
  281.         {
  282. //    store the new values to the document
  283.         pr6->GetText(pPran);                                                                        // get the text
  284.         itsPran = p2cstr((StringPtr) pPran);                                                // convert to c
  285.         p6 = atof(itsPran);                                                                            // convert to float
  286.             
  287.         pr7->GetText(pPran);                                                                        // get the text
  288.         itsPran = p2cstr((StringPtr) pPran);                                                // convert to c
  289.         p7 = atof(itsPran);                                                                            // convert to float
  290.  
  291.         ((TCFDFrontDocument *) fDocument)->SetTurbulenceOpts(p6,p7);        // store the data
  292.         }
  293.     
  294.     aWindow->Close();                                                                                // close the window
  295.     return;
  296.     }
  297.     
  298. //------------------------------------------------------------------------------------------
  299. //    TTurbulence - GetParams
  300. //------------------------------------------------------------------------------------------
  301. void TPressure::GetParams(void)
  302.     {
  303.     float                p5;
  304.     extended        p;
  305.     TWindow     * aWindow;                                                                            // window for this dialog
  306.     TEditText    * pr, *pr5;
  307.     IDType            dismisser;
  308.     Str255            pPran;
  309.     StringPtr        pText;
  310.     char         *    itsPran, iPran[20];
  311.     
  312.     aWindow = this->GetWindow();                                                                // get the window
  313.     HLock((Handle) this);
  314.     ((TCFDFrontDocument *) fDocument)->GetPressureOpts(&p,&p5);        // store the data
  315.     HUnlock((Handle) this);
  316.  
  317.     this->fDefaultItem = 'OKOK';                                                                    // set the default items
  318.     this->fCancelItem = 'CNCL';
  319.  
  320. //    get reference to each data object in the dialog box
  321.     pr = (TEditText *) aWindow->FindSubView('PR01');                                // get the edit box
  322.     pr5 = (TEditText *) aWindow->FindSubView('PR02');                            // get the edit box
  323.     
  324. //    set the initial values for the data 
  325.     sprintf(iPran,"%E",p);                                                                            // convert to string
  326.     pText = c2pstr(iPran);                                                                            // convert to pascal
  327.     pr->SetText(pText,true);                                                                        // display the value
  328.     
  329.     sprintf(iPran,"%f",p5);                                                                        // convert to string
  330.     pText = c2pstr(iPran);                                                                            // convert to pascal
  331.     pr5->SetText(pText,true);                                                                    // display the value
  332.     
  333. //    get the new values    
  334.     dismisser = this->PoseModally();                                                            // pose the question
  335.         
  336.     if (dismisser == kOK)                                                                            // ok button
  337.         {
  338. //    store the new values to the document    
  339.         pr->GetText(pPran);                                                                            // get the text
  340.         itsPran = p2cstr((StringPtr) pPran);                                                // convert to c
  341.         p = atof(itsPran);                                                                                // convert to float
  342.             
  343.         pr5->GetText(pPran);                                                                        // get the text
  344.         itsPran = p2cstr((StringPtr) pPran);                                                // convert to c
  345.         p5 = atof(itsPran);                                                                            // convert to float
  346.  
  347.         ((TCFDFrontDocument *) fDocument)->SetPressureOpts(p,p5);        // store the data
  348.         }
  349.     
  350.     aWindow->Close();                                                                                // close the window
  351.     return;
  352.     }
  353.     
  354. // -----------------------------------------------------------------------------------------
  355. //    get the dimensions of the geometry.
  356. //    throw up the initial MODAL get dimensions dialog box.
  357. // -----------------------------------------------------------------------------------------
  358. Boolean TDimension::GetDimensions (void)
  359.     {
  360.     TWindow * aWindow;                                                                    // debug window
  361.     TEditText * Dimension;
  362.     IDType         dismisser;
  363.  
  364.     aWindow = this->GetWindow();                                                        // create the window
  365.     
  366.     // select the x dimension.
  367.     Dimension = (TEditText *) (aWindow->FindSubView ('xdim'));        // find xdim
  368.     Dimension->SetSelection (1, 32000, true);                                    // set the selection
  369.     
  370.     // get the dimsDialog
  371.     this->fDefaultItem = 'OKOK';                                                            // set the default items
  372.     this->fCancelItem = 'CNCL';
  373.     
  374.     dismisser = this->PoseModally();                                        // is a modal dialog
  375.     
  376.     if (dismisser == kOK)                                                                    // clicked ok
  377.         {
  378.         char sizeStr[256];
  379.         float width, height;
  380.         
  381.         Dimension->GetText ((StringPtr) sizeStr);                                // get the x dimension
  382.         p2cstr ((StringPtr) sizeStr);                                                    // convert to c
  383.         width = atof(sizeStr);
  384.         
  385.         Dimension = (TEditText*) (aWindow->FindSubView ('ydim'));    // get the y sizeStr
  386.         Dimension->GetText ((StringPtr) sizeStr);                                // get the text
  387.         p2cstr ((StringPtr) sizeStr);                                                    // convert to c
  388.         height = atof(sizeStr);
  389.         ((TCFDFrontDocument *) fDocument)->SetDimensions(width,height); // store info in document
  390.         
  391.         aWindow->Close();                                                                    // close the window
  392.         return true;                                                                                // return true
  393.         }
  394.     else
  395.         {
  396.         aWindow->Close();                                                                    // close the window
  397.         return false;                                                                                // return false
  398.         }
  399.     }
  400.         
  401. // -----------------------------------------------------------------------------------------
  402. // -----------------------------------------------------------------------------------------
  403. Boolean TImageDialog::GetImage (char * string)
  404.     {
  405.     TWindow     * aWindow;                                
  406.     TEditText * app;
  407.     IDType         dismisser;
  408.     char            test[30];
  409.     StringPtr        pText;
  410.  
  411.     aWindow = this->GetWindow();                                                                    // create the window
  412.  
  413.     // select the x dimension.
  414.     app = (TEditText *) (aWindow->FindSubView ('name'));                    // find appl
  415.  
  416.     if (strlen(string) == 0)
  417.         sprintf(test,"Result.Image");                                                                // convert to string
  418.     else
  419.         strcpy(test,string);
  420.     pText = c2pstr(test);                                                                                    // convert to pascal
  421.     app->SetText (pText, TRUE);                                                                        // set the selection
  422.     
  423.     // get the dimsDialog
  424.     this->fDefaultItem     = 'OKOK';                                                                    // set the default items
  425.     this->fCancelItem     = 'CNCL';
  426.     
  427.     dismisser = this->PoseModally();                                                            // is a modal dialog
  428.     
  429.     if (dismisser == kOK)                                                                                    // clicked ok
  430.         {
  431.         char text[256];
  432.         
  433.         app->GetText ((StringPtr) text);                                                        // get the application
  434.         p2cstr ((StringPtr) text);                                                                    // convert to c
  435.         
  436.         ((TCFDFrontDocument *) fDocument)->SetImageName(text);             // store info in document
  437.         
  438.         aWindow->Close();                                                                                        // close the window
  439.         return true;                                                                                                // return true
  440.         }
  441.     else
  442.         {
  443.         aWindow->Close();                                                                                        // close the window
  444.         return false;                                                                                                // return false
  445.         }
  446.     }
  447.         
  448. // -----------------------------------------------------------------------------------------
  449. // -----------------------------------------------------------------------------------------
  450. Boolean TAppDialog::GetApp (char * string)
  451.     {
  452.     TWindow     * aWindow;                                
  453.     TEditText * app;
  454.     IDType         dismisser;
  455.     char            test[30];
  456.     StringPtr        pText;
  457.  
  458.     aWindow = this->GetWindow();                                                                    // create the window
  459.  
  460.     // select the x dimension.
  461.     app = (TEditText *) (aWindow->FindSubView ('appl'));                    // find appl
  462.  
  463.     if (strlen(string) == 0)
  464.         sprintf(test,"tryme");                                                                            // convert to string
  465.     else
  466.         strcpy(test,string);
  467.     pText = c2pstr(test);                                                                                    // convert to pascal
  468.     app->SetText (pText, TRUE);                                                                        // set the selection
  469.     
  470.     // get the dimsDialog
  471.     this->fDefaultItem     = 'OKOK';                                                                    // set the default items
  472.     this->fCancelItem     = 'CNCL';
  473.     
  474.     dismisser = this->PoseModally();                                                            // is a modal dialog
  475.     
  476.     if (dismisser == kOK)                                                                                    // clicked ok
  477.         {
  478.         char text[256];
  479.         
  480.         app->GetText ((StringPtr) text);                                                        // get the application
  481.         p2cstr ((StringPtr) text);                                                                    // convert to c
  482.         
  483.         ((TCFDFrontDocument *) fDocument)->SetApp(text);                         // store info in document
  484.         
  485.         aWindow->Close();                                                                                        // close the window
  486.         return true;                                                                                                // return true
  487.         }
  488.     else
  489.         {
  490.         aWindow->Close();                                                                                        // close the window
  491.         return false;                                                                                                // return false
  492.         }
  493.     }
  494.         
  495. // -----------------------------------------------------------------------------------------
  496. //    TWarnDelete
  497. //    Warn the user they are about to delete something
  498. // -----------------------------------------------------------------------------------------
  499. Boolean TWarnDelete::ShowDelete (char * message)
  500.     {
  501.     TWindow * aWindow;                                                                    // debug window
  502.     TEditText * tText;
  503.     IDType         dismisser;
  504.     StringPtr        pText;
  505.  
  506.     aWindow = this->GetWindow();                                                        // create the window
  507.  
  508.     tText = (TEditText *) (aWindow->FindSubView ('dmsg'));                // find text box
  509.     pText = c2pstr(message);                                                                // convert to pascal
  510.     tText->SetText(pText,true);                                                        // display the value
  511.     
  512.     // get the dimsDialog
  513.     this->fDefaultItem = 'OKOK';                                                            // set the default items
  514.     this->fCancelItem = 'CNCL';
  515.     
  516.     dismisser = this->PoseModally();                                                    // is a modal dialog
  517.     
  518.     if (dismisser == kOK)                                                                    // clicked ok
  519.         {        
  520.         aWindow->Close();                                                                    // close the window
  521.         return true;                                                                                // return true
  522.         }
  523.     else
  524.         {
  525.         aWindow->Close();                                                                    // close the window
  526.         return false;                                                                                // return false
  527.         }
  528.     }
  529.         
  530.