Raised This Month: $51 Target: $400
 12% 

Return inside ``'s


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 12-25-2011 , 07:11   Return inside ``'s
Reply With Quote #1

For example:

`Kill_1` = '5', `Kill_2` = '6'
or
`Kill_1` = '5', `Kill_2` = '8', `Kill_3` = '9'


How to return all strings inside ``'s
__________________
Retired.
Xalus is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-25-2011 , 07:14   Re: Return inside ``'s
Reply With Quote #2

Explain better from what you start and what you want as result please.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 12-25-2011 , 07:23   Re: Return inside ``'s
Reply With Quote #3

Its for achievement api,

so I save with a stringt,

for example:

Ach_Save("`Kill_1` = '5', `Kill_2` = '8', `Kill_3` = '9'", steamid)

Then main achievement handler,

needs to get all inside ``'s
->
So: `Kill_1` `Kill_2` `Kill_3`

& then I can check if player earned an achievement.

I hope u understand it a little more now :p
__________________
Retired.
Xalus is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-25-2011 , 07:40   Re: Return inside ``'s
Reply With Quote #4

And what is the problem ?
If a char is not passed or make the string to be cut, then use the ctrl char \ before that char.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-25-2011 , 18:32   Re: Return inside ``'s
Reply With Quote #5

I don't entirely understand what you are actually doing but it sounds like you need to rethink your method of storing that info and how you store it in memory when you read it from where you permanently store it.

How are you storing this info in permanent storage? Nvault? txt? etc.
__________________
fysiks is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 12-25-2011 , 23:52   Re: Return inside ``'s
Reply With Quote #6

I'm guessing that he's using SQL, and he's using the single quotations to signify a string in mysql.

You could use the escape character '^' in order to use the single quotations without the compiler thinking that it is a start of a char. Then, you could use strtok or strbreak in order to get the individual parameters within it.

For example: Ach_Save("^'Kill_1^' = ^'5^', ^'Kill_2^' = ^'8^', ^'Kill_3^' = ^'9^'", steamid );
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-26-2011 , 00:20   Re: Return inside ``'s
Reply With Quote #7

Quote:
Originally Posted by nikhilgupta345 View Post
I'm guessing that he's using SQL, and he's using the single quotations to signify a string in mysql.

You could use the escape character '^' in order to use the single quotations without the compiler thinking that it is a start of a char. Then, you could use strtok or strbreak in order to get the individual parameters within it.

For example: Ach_Save("^'Kill_1^' = ^'5^', ^'Kill_2^' = ^'8^', ^'Kill_3^' = ^'9^'", steamid );
You don't need to escape a non-control character.
__________________
fysiks is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 12-26-2011 , 10:07   Re: Return inside ``'s
Reply With Quote #8

Quote:
Originally Posted by fysiks View Post
You don't need to escape a non-control character.
:O Just realized that.

No idea what he's asking for then.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
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 07:42.


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