First off, I recommend putting spaces in ur strings to make things more
readable.
Secondly, "what" is the problem your having? We can't help if we don't know
what the problem is.
Thirdly, you could use "\n\r" instead of just \n. That way you can port to
windows easily w/o worrying about it not viewing correctly.

Rheede

----- Original Message -----
From: "Mervine, Keith" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, April 17, 2003 12:58 PM
Subject: Problem with file again..


> Can someone see something wrong with this function to print out skills
> to  comma delimited file?
>
> void do_skillcd(CHAR_DATA *ch,char *argument)
> {
>     char arg1[MIL];
>     char buf[MSL];
>     int i;
>     int skill;
>     int x;
>     FILE *fp;
>
>     fclose( fpReserve );
>     fp = fopen("../../public_html/files/skillcd.txt", "w" );
>
>     fprintf (fp,"Class");
>
>     for (x = 0; x < MAX_CLASS; x++);
>         {
>           sprintf(buf, ",%s",class_table[x].name);
>           fprintf(fp, buf);
>         }
>
>     sprintf(buf,"\n");
>     fprintf(fp,buf);
>
>     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);
>     }
>
>     fclose( fp );
>
>     send_to_char("Done writing\n\r",ch);
>     fpReserve = fopen( NULL_FILE, "r" );
>     return;
> }


Reply via email to