Okay, this did the same thing:
#include <stdio.h>
void main(){
int r,g,b,result;
char cname[80];
FILE *rgb,*color;
rgb=fopen("rgb.txt","r");
color=fopen("XColor.java","w+");
while(!feof(rgb)){
fscanf(rgb,"%d%d%d%s",&r,&g,&b,cname);
fprintf(color," ////////////////////\n");
fprintf(color," // The color %s\n",cname);
fprintf(color," ////////////////////\n\n");
fprintf(color," public final static Color %s = new
Color(%d, %d, %d);\n\n",cname,r,g,b);
}
fclose(rgb);
fclose(color);
}
_______________________________
Berrex Computer Solutions
Turnkey Solutions/Consulting
Software Development
http://www.albany.net/~berrex
berrex@albany.net