Raised This Month: $ Target: $400
 0% 

fputs() problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
matsi
Thinkosaur
Join Date: Sep 2006
Old 12-20-2009 , 17:25   Re: fputs() problem
Reply With Quote #5

Quote:
Originally Posted by grimvh2 View Post
When I use fputs() I can only save 1 line in a .ini or .cfg file.

Im using it like this

Code:
public do_savecmd(id,szNewcmd[],szOldcmd[], szType[])
{
    new iFile = fopen(Path, "w");
    if( !iFile )
        return;
    
    new const szData[100];
    format(szData,sizeof(szData)-1, "^"%s^" ^"%s^" ^"%s^"",szNewcmd,szOldcmd, szType)
    
    fputs(iFile, szData);
    fclose(iFile);
    
    console_print(id, "New Command : %s",szNewcmd)
    console_print(id, "Old Command : %s",szOldcmd)
    console_print(id, "Type : %s", szType)
}
So when I put something in the file, it goes in there. but when I want to put something new in it. It deletes the first line and puts in the new.
^n


edit: What about using flags "at"? Would that be correct or incorrect?

Last edited by matsi; 12-20-2009 at 17:29.
matsi is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode