Raised This Month: $ Target: $400
 0% 

read file


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Sanjay Singh
Veteran Member
Join Date: Sep 2016
Old 01-07-2020 , 06:56   read file
Reply With Quote #1

How can i store lines data in array?
Its not working properly sometimes it just print 1st array or sometimes last.
Code

PHP Code:
new StoreData[128][128];
new 
testfile[255];

public 
loadStoreData()
{
    
get_configsdir(testfile,255)
    
format(testfile,255,"%s/test.ini",testfile)

    new 
line;
    new 
file fopen(testfile,"r")

    if(
file)
    {
        new 
data[128]
        while(
fgets(filedata127))
        {
            if(
data[0] == ';' || !data[0]) continue
            
parse(datadata127)

            
StoreData[line] = data
            line
++
        }
        
fclose(file)
    }

    for(new 
0sizeof linei++){ 
        
server_cmd("say %s"StoreData[i]);
    }

__________________

Last edited by Sanjay Singh; 01-07-2020 at 06:59.
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
 


Thread Tools
Display Modes

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 02:56.


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