Raised This Month: $ Target: $400
 0% 

[ Enum Loop ]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xablau
Member
Join Date: Dec 2014
Old 01-08-2015 , 18:32   [ Enum Loop ]
Reply With Quote #1

i have:

g_ePlayerData[id][hats] = "a|b|c|d"

How to:

loop(g_ePlayerData[id][hats])
// Print a
// Print b
// Print c
...
Xablau is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-08-2015 , 18:45   Re: [ Enum Loop ]
Reply With Quote #2

This has nothing to do with looping through an enum. You need to parse the string into an array.
__________________
fysiks is offline
Xablau
Member
Join Date: Dec 2014
Old 01-08-2015 , 18:49   Re: [ Enum Loop ]
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
This has nothing to do with looping through an enum. You need to parse the string into an array.
I want to give a explodes by "|" and then list item by item.
Xablau is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-08-2015 , 18:53   Re: [ Enum Loop ]
Reply With Quote #4

You'll need to loop using strtok(). Use strtok() then check if 'Right' contains the token, if yes, do it again.

I'm quite sure that there exists an explode function somewhere here in the forums. I'd look in the tutorials section first.
__________________
fysiks 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 15:20.


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