Raised This Month: $ Target: $400
 0% 

Reading from a .txt file...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-26-2008 , 22:54   Re: Reading from a .txt file...
Reply With Quote #2

Wrong section. Moved to scripting help.

Code:
new filename[64]; // this is the name of your file to read from copy(filename, 63, "motd.txt"); // lets use motd.txt for the example if( file_exists(filename) ) {     new file = fopen(filename, "rt");         new data[64]; // information taken from the file, 1 line at a time     while( !feof(file) ) // keep looping until we find the end of the file     {         fgets(file, data, 63); // retrieve information         // Note: it will automatically go to the next line                 // data contains the information from the line read     }         // close file     fclose(file); }

Use the funcwiki for information about the natives.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 05:37.


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