PDA

View Full Version : Help (programming in dbase 3 & C)



BeckyBair
07-18-2005, 12:18 PM
Hi,

I don't know if anyone can help but I was given a project to find an issue in a very very old (DOS) application that 1/2 of our users still use. This app was developed using files that end with .prg and .c extentions. I have been told to use Clipper 5.2 to debug and then Clipper "summer '87" to do the actual compile/linking. I have never heard of this before and do not know how to manual compile/link or debug. (I usually code in VB 6.0)

My question is: Does anyone have any idea of any software that is newer but can import this older code into something newer that can compile and debug non-manually? Or if someone knows of any websites that can help me to learn this older code process?

Anything would be helpful. :confused:

Thanks,
Becky

major_small
07-18-2005, 12:32 PM
you mean this clipper 5.2 (http://www.clipx.net/ng/clguide/index.php)?

BeckyBair
07-18-2005, 12:34 PM
yes, that clipper

Sample from the .prg code:


*
* First load data into "input" arrays in Local Currency
*

qorg(prodobj, th_pgn() )

queryprod(@prodobj)


if !hasdata(prodobj)
* no data!
if Excflag > 3 && force fail of exc. condition
Prodok= .f. && for products w/o data
endif
return && ABORT PROCESSING
endif


Sample from the .c code:


void calc_pvar(DFAORG * dfa)

/* -------------------------------------------------------------
performs price variance calculations upon DFA org;
assumes logical checks have already been performed.
------------------------------------------------------------- */
{
double year_sales = 0.000;
double year_units = 0.000;
double benchprice;
double unit_variance;
double variance;
register int i;
double * sales; /* pointer to appropriate array */
double * base_sales; /* pointer to appropriate array */
int need_conversion;

/* point to appropriate arrays for calculations */
if ( HI_INFLATION && (dfa->currency == 'D') )
{
sales = Usd.sales_at_base;
base_sales = Usd.base_sales;
}
else
{
sales = dfa->sales;
base_sales = dfa->base_sales;
}

need_conversion = ( (dfa->currency == 'D') && LO_INFLATION );