1.

Solve : C LIB Help?

Answer»

Hi,
My first attempt to add a FUNCTION to the C LIB, fail's to compile:

Code: [Select]/* test.c */
#include <stdio.h>
#include <stdarg.h>
#include “test.h” /* DSP header file */

#define maxent (sm) (sm->txt->hn.numelem)

#define MIN(a,B) ((a) < (b) ? (a) : (b))
void displist (menudesc *sm) ;

void displist (menudesc *sm)

/*
Parameters:
*sm * pointer to DSP structure
*/
{
int i,m,n,x,y,col;
strlist tl;

/* calculate's MIN between DSP area and DSP items */

n= MIN(maxent (sm) - sm->scrofs,sm->area) ;

m = n+sm->scrofs; /* add minimum to _s offset */
selectwindow (sm->w) ; /* select as mounted */
clrwin (NULL, 0); /* CLEAR */

tl = getstrptr(sm->scrofs +1, sm->txt); /* point to first item */
/* write */
for (i = sm->scrofs, x=0, y=0, col=1; (i<m); i++) {
prthz (x,y,tl->dn.elem.data, sm->w->wndatr,tl->dn.elem.len) ;
tl = tl->dn.next; /* get 1st */
if (++y >= sm->nrows) { /* goto 2nd */
y = 0; col++;
x = colx(col, sm) ; /* DETERMINE loc */
}
}
}



The line compiler APPEARS to flag states:

Code: [Select] n= MIN(maxent (sm) - sm->scrofs,sm->area) ;

The C compiler reports:
Quote


C2064 : ERROR : term does not evaluate to a function


I'm stumpt and would appreciate any help with this C syntax, since I'm in transition from BASIC.
thx
qito


Discussion

No Comment Found