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

Thread: ListBox to Array

  1. #1
    Join Date
    Apr 2002
    Los Angeles, Ca

    ListBox to Array(resolved)

    Hi everyone ...
    I need to loop through a listbox(figured out), then remove the last character from the listbox item(Problem) then assign that to a new array.
    Here is some of the code..
    Dim sWorkingString As String

    For i = 0 To 14
    If filmTitle(i) <> "" Then 'Without this it adds several Empty lines
    Form2.List1.AddItem filmTitle(i) & i
    End If

    Next i
    For i = 0 To Form2.List1.ListCount - 1

    sWorkingString = CStr(Form2.List1.List(i))

    Here is the problem....
    sWorking String is a string, but when I try to use Len and Left$ to return all but the LAST letter, I am getting "declared variable does not match type declaration character" error

    What am i doing wrong?

    Last edited by Hobbit K; November 17th, 2003 at 10:32 PM.

  2. #2
    Join Date
    Apr 2002
    Los Angeles, Ca
    Got it ...
    sWorkingString = Left$(sWorkingString, (Len(sWorkingString) - 1))

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)