CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: text box

  1. #1
    Join Date
    Aug 2001
    Posts
    28

    text box

    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?


  2. #2

    Re: text box

    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/im...ertaplanet.gif'>
    </center>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured