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.

> 
> 
> -----Original Message-----
> From: Michael S. Davis <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> Date: Tuesday, March 30, 1999 9:37 AM
> Subject: Why does program get larger?
> 
> 
> >I have a program where I am filling some string values.
> >
> >In my first, quick, attempt, I repeated some code
> >three times that performed this function three times.
> >
> >So I decided to create a routine that I could call
> >three times rather than having the code repeated.  Everything
> >that is in the new routine was cut-and-pasted from what
> >was repeated.  No new code.
> >
> >My question is: Why did my program grow when I used
> >the single routine rather than the repeated code?  It
> >seems like the version that had the repeated code would
> >be larger.
> >
> >
> >Below is the structure of the new code.  The original code
> >had the contents of SetStringVal repeated in the routine
> >following SetStringVal.
> >
> >SetStringVal(char * str, char * strVal)
> >{
> >// This code was repeated three times in the routine below
> >}
> >// where d1, p2, p1 are char *.
> >
> >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++)
> >            {
> >                SetStringValue(d1, &k);  // code above replaced by call
> >                SetStringValue(p2, &j);  //
> >                SetStringValue(p1, &i);  //
> >            }
> >        }
> >    }
> >}
> >
> >
> 
> 
> 

----------------------------------------------------
Shoot-to-Win

Protect the 2nd Amendment
----------------------------------------------------

Reply via email to