Raised This Month: $ Target: $400
 0% 

Breaking socket data on lines?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-26-2011 , 20:04   Re: Breaking socket data on lines?
Reply With Quote #4

Quote:
Originally Posted by ProIcons View Post
ehm , lets say
that your variable that the socket stores the new data is

data[900]

you can simple do it with

server_print("%s\n\r",data)
He wanted to find separate lines within the variable.

Example:
Code:
new data[128]; copy(data, charsmax(data), "oh, line #1^r^nline #2^r^nand look like #3!^r^n^r^na blank line betwen!");

To find those you would use the ExplodeString() like he did or this:

Code:
new line[32]; while(data[0]) {     strtok(data, line, charsmax(line), data, charsmax(data), '^n');         // line variable is one of those lines. }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
 



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 04:18.


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