Click to See Complete Forum and Search --> : text box


ma622
August 25th, 2001, 08:18 AM
i have a function that sends a message to ICQ number...
and i have a text box that conatins icq nuymbers like:
110179904
110178954
123789545

so i want my program to use the function on line by line in the text box

how?

berta
August 26th, 2001, 08:23 AM
U can try with something of this:

dim idxA as long
dim idxB as long

dim sep
dim sep_len as long

sep = vbcrlf
sep_len=len(sep)

dim icq_number as string

idxA=0
idxB=0
do
idxB = instr(idxA,textbox.text,sep)
if idxB=0 then
icq_number=mid(textbox.text,idxA)
'{call to function for send msg to icq_number }
exit do
else
icq_number=mid(textbox.text,idxA+len_sep,idxA-idxB-len_sep)
'{call to function for send msg to icq_number }
idxA=idxB+len_sep
end if
loop

but whya do U not use listbox instead of textbox... with a listbox U can use more simple loop and no parser...

dim i as long
dim icq_number as string
for i=0 to listbox.count-1
icq_number=listbox.items(i)
'{call to function for send msg to icq_number}
next i

hi,brt

<center>
<HR width=80%>
<img src='http://web.tiscali.it/bertaplanet/images/bertaplanet.gif'>
</center>