Results 1 to 3 of 3

Thread: Saving a list and explanations in 1 file

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800

    Unhappy

    I want to make a list, and when you click on one of the items, it will give you an explanation. How do I make this save as one file instead of each having its own file?

  2. #2
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Question

    Is this something where you could use the resource file editor to store the descriptions? Then when the user clicks the item, load the string that is associated with it into a messagebox or balloon help or whatever?

  3. #3
    Guest
    You need two lists.
    One for the items and one the comments.

    Code:
    Public Sub List_Load(TheList As ListBox, FileName As String)
    '// Loads a file to a list box
    On Error Resume Next
    Dim TheContents As String
    Dim fFile As Integer
    fFile = FreeFile
     Open FileName For Input As fFile
       Do
         Line Input #fFile, TheContents$
            Call List_Add(TheList, TheContents$)
       Loop Until EOF(fFile)
     Close fFile
    End Sub
    
    Public Sub List_Save(TheList As ListBox, FileName As String)
    '// Save a listbox as FileName
    On Error Resume Next
    Dim Save As Long
    Dim fFile As Integer
    fFile = FreeFile
    Open FileName For Output As fFile
       For Save = 0 To TheList.ListCount - 1
          Print #fFile, TheList.List(Save)
       Next Save
    Close fFile
    End Sub
    
    In the lists:
    
    List1:
    On Error Resume Next
    List2.ListIndex = List1.ListIndex
    'You could also make some text popup telling you:
    'Msgbox list2
    'Or something like that
    Hope you understand.


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