Raised This Month: $ Target: $400
 0% 

parse a line


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gamer99
Senior Member
Join Date: Jul 2011
Old 12-08-2011 , 09:17   parse a line
Reply With Quote #1

Hi ,

In one of my file it is like

name power level

Now I have put into one array.
So now I have taken the string from that array like

ArrayGetString(g_sNames,i,sBuffer,63)

So sBuffer = name power level

Now I need to put the name into one variable, power into another and level into another. Can anybody please help me on that?
__________________
Thanks and regards,
Gamer99
gamer99 is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 12-08-2011 , 09:20   Re: parse a line
Reply With Quote #2

parse()
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
gamer99
Senior Member
Join Date: Jul 2011
Old 12-08-2011 , 09:34   Re: parse a line
Reply With Quote #3

Code:
		parse(sBuffer,name,33,day,5,month,5,year,5) 
		server_print("Name - %s, Day %s,Month %s, Year %s",name,day,month,year)
When I am trying this I am getting error like

array must be index

Any help?
__________________
Thanks and regards,
Gamer99
gamer99 is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 12-08-2011 , 11:37   Re: parse a line
Reply With Quote #4

How did you declare your variables ?
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-08-2011 , 16:20   Re: parse a line
Reply With Quote #5

Just remember that the name cannot have any spaces or other characters that make parse() think the argumenet has ended. If it has any of these characters you need to put the entry in quotes.
__________________
fysiks is offline
gamer99
Senior Member
Join Date: Jul 2011
Old 12-09-2011 , 04:32   Re: parse a line
Reply With Quote #6

Solved

Thanks drekes and fysiks
__________________
Thanks and regards,
Gamer99
gamer99 is offline
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 11:57.


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