I'm coding an irc client, or trying actually. Just wondering if anyone can give me an example of looping through a string, and for each line calling a function on it.. i already have the function but im just looking for an example on how to get each line individually.. because some servers send data like "line1<crlf>line2<crlf>" and i want to be able to get the line 1 and line 2 so i can parse specific data out of it. any help will be appreciated. :alright:
Posted on 2001-10-01 17:40:43 by freedumb
I'm trying the same thing, but I can't seem to return PING :<data> with PONG :<data>...

Anyone know how?
Posted on 2001-10-01 17:43:31 by ircbuddy
Something like this?

.model flat, stdcall
option casemap :none

include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc

includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib

szString db "line1", 13, 10, "line2", 13, 10, "line3", 13, 10, "line4", 13,10, 0

szBuffer db 512 dup (?)

lea esi, szString
lea edi, szBuffer
mov al, [esi]
cmp al, 13
je @F
mov [edi], al
inc esi
inc edi
or al, al
je @@exit
jmp @@start
push esi
invoke MessageBox, 0, addr szBuffer, 0, 0
pop esi
add esi, 2 ;inc esi ; uncomment if CR
lea edi, szBuffer
jmp @@start

invoke ExitProcess, eax

end testapp
Posted on 2001-10-01 17:49:26 by bazik