Date sent:              Tue, 30 Mar 1999 18:42:21 -0800
From:                   "Chris Antos" <[EMAIL PROTECTED]>
Subject:                Re: Why does program get larger?
To:                     <[EMAIL PROTECTED]>
Send reply to:          [EMAIL PROTECTED]

> it is very likely this is due to something you did, and not any 
problem on
> the compiler's end.  but it's definitely interesting to get to the bottom of
> it.  the reason i asked how long the routine was, is because if it was in
> the area of only say 5 lines long, it may take more code to push the
> parameters onto the stack and call the function, than it took to do the
> operations inline.

Here is the code:  the three switch statements were placed in a 
seperate function and i, j, k are passed to the function along with 
the specific string variable that is to be updated.

static void FillDB()
{
        UInt i, j, k;

        curIdx=0;
        for(i=0; i < 10; i++)
        {       
                for(j=0; j < 10; j++)
                {
                        for(k=0; k < 10; k++)
                        {
                                switch (k)
                                {
                                        case 2:
                                        case 3:
                                        case 4:
                                        case 5:
                                        case 6:
                                        case 7:
                                        case 8:
                                        case 9:
                                                ltoa(d1, k);
                                                break;
                                        case 0:
                                                StrCopy(d1, "X");
                                                break;
                                        case 1:
                                                StrCopy(d1, "A");
                                                break;
                                }
                                switch (j)
                                {
                                        case 2:
                                        case 3:
                                        case 4:
                                        case 5:
                                        case 6:
                                        case 7:
                                        case 8:
                                        case 9:
                                                ltoa(p2, j);
                                                break;
                                        case 0:
                                                StrCopy(p2, "X");
                                                break;
                                        case 1:
                                                StrCopy(p2, "A");
                                                break;
                                }
                                switch (i)
                                {
                                        case 2:
                                        case 3:
                                        case 4:
                                        case 5:
                                        case 6:
                                        case 7:
                                        case 8:
                                        case 9:
                                                ltoa(p1, i);
                                                break;
                                        case 0:
                                                StrCopy(p1, "X");
                                                break;
                                        case 1:
                                                StrCopy(p1, "A");
                                                break;
                                }
                                StrCopy(system.cards, p1);
                                StrCat(system.cards, p2);
                                StrCat(system.cards, d1);
                                system.play = 0;
                                StrCopy(system.note, "Dummy Note!");
                                PutNewRec();
                        }
                }
        }
}

> 
> 
> -----Original Message-----
> From: Michael S. Davis <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> Date: Tuesday, March 30, 1999 3:07 PM
> Subject: Re: Why does program get larger?
> 
> 
> >On Tue, 30 Mar 1999, Chris Antos wrote:
> >
> >> how long was the routine?
> >> did you delete all objects files before rebuilding?
> >> are you saying the PRC on your PC is larger, or that the Memory (or Info)
> >> command on the Pilot shows it as larger?
> >
> >The PRC file was larger.
> 
> 
> 


--
-----------------------------------------------------------------
Discussion Group:        http://www.halcyon.com/ipscone/wwwboard/

Protect your constitutional rights. Your favorite one may be next!
-----------------------------------------------------------------

Reply via email to