Greetings,
I have written a small function to list all skills and levels
the classes receive the skills at in a comma delimited format.
void do_skillcd(CHAR_DATA *ch,char *argument)
{
char arg1[MIL];
char buf[MSL];
int i, sn, skill,class = 0;
FILE *fp;
fclose( fpReserve );
fp = fopen("../data/skillcd.txt", "w" );
for (sn = 0; sn < MAX_SKILL; sn++)
{
sprintf(buf,"%s",skill_table[sn].name);
fprintf(fp, buf);
for (i=0; i < MAX_CLASS; i++)
{
sprintf(buf,",%d",skill_table[sn].skill_level[i]);
fprintf(fp, buf);
}
sprintf(buf,"\n");
fprintf(fp,buf);
}
send_to_char("Done writing\n\r",ch);
fpReserve = fopen( NULL_FILE, "r" );
return;
}
However, about 508 lines into the file im writing (skillcd.txt) it
stops. Same place everytime.
**Lines 507 and 508 of output file
dragonsword,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,
111,111,111
holy armor,111,111,111,111,111,111,
** End
Is there something wrong with this code? What am I missing?
Keith Mervine
"Non Omnis Moriar"
"Growing old is mandatory, growing up is optional"
Service Management Application Developer
International Monetary Fund
[EMAIL PROTECTED]
202-623-7610