[En-Nut-Discussion] Need Help on Matrix prog_char

iVesWorking iVesWorking at hotmail.com
Tue Aug 3 07:08:07 CEST 2004


I using Alot of string in my application.
so i build a few String Loopup table
that using

void gstring(FILE * stream,int line)
{
static prog_char zman1[]="DeviceA[%d] %s <p>\n";
static prog_char zman2[]="DeviceB[%d] %s <p>\n";
     if (line==1)fprintf_P(stream,zman1);
else if (line==2)fprintf_P(stream,zman2);

}

i planning to do it using matrix

void gstring(FILE * stream,int line)
{
    static prog_char *zman[3];
    zman[0]= "";
    zman[1]= "DeviceA[%d] %s <p>\n";
    zman[2]= "DeviceB[%d] %s <p>\n";
    fprintf_P(stream,zman[1],);

}

But Matrix prog_char was not working. Anyway to build a string lookup table
to save me some if else statement that waste rom space?

since i use nearly 100 of if else statement on building my string lookup
table.

WF



More information about the En-Nut-Discussion mailing list