Raised This Month: $ Target: $400
 0% 

Can someone help with read_file


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sibox
Member
Join Date: Apr 2009
Location: Bulgaria
Old 01-02-2011 , 02:37   Can someone help with read_file
Reply With Quote #1

How can i read line by line file and if the file has // on the line to not show this line and go to next
sibox is offline
Send a message via Skype™ to sibox
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-02-2011 , 02:40   Re: Can someone help with read_file
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?t=46218

To check if the data from a line contains "//", there are 3 ways you can check:
Code:
if(szData[0] == '/' && szData[1] == '/') if(equal(szData, "//", 2)) if(contain(szData, "//") == 0)

I advise you to use the first one because it does not require a native call.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
sibox
Member
Join Date: Apr 2009
Location: Bulgaria
Old 01-02-2011 , 02:42   Re: Can someone help with read_file
Reply With Quote #3

Thank you, sir but i'm trying to use this for
Code:
public ReadKey(szLine[]) {     new szBuffer[32];     new b = 0;     read_file(g_Buttons, szLine, szBuffer, 31, b) }
sibox is offline
Send a message via Skype™ to sibox
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-02-2011 , 02:43   Re: Can someone help with read_file
Reply With Quote #4

The line must be an integer, not a string.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
sibox
Member
Join Date: Apr 2009
Location: Bulgaria
Old 01-02-2011 , 02:44   Re: Can someone help with read_file
Reply With Quote #5

how can i set it to integer str_to_num ?
sibox is offline
Send a message via Skype™ to sibox
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-02-2011 , 02:45   Re: Can someone help with read_file
Reply With Quote #6

Yes.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
sibox
Member
Join Date: Apr 2009
Location: Bulgaria
Old 01-02-2011 , 02:48   Re: Can someone help with read_file
Reply With Quote #7

Code:
public ReadKey(szLine[]) {     str_to_num(szLine);     new szBuffer[32];     new b = 0;     read_file(g_Buttons, szLine, szBuffer, 31, b) }
and again not working. Error: Argument type mismatch (argument 2) on line 41
sibox is offline
Send a message via Skype™ to sibox
sibox
Member
Join Date: Apr 2009
Location: Bulgaria
Old 01-02-2011 , 02:50   Re: Can someone help with read_file
Reply With Quote #8

I fix it thank you very much exo and one more question how can i get the maxlines in the file?

Last edited by sibox; 01-02-2011 at 02:53.
sibox is offline
Send a message via Skype™ to sibox
Reply



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:08.


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