Chat LIVE With Programming Experts! There Are 23 Online Right Now...

Welcome to Dream.In.Code
Become a VB Expert!

Join 244,306 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 788 people online right now. Registration is fast and FREE... Join Now!




loading .txt file into vb6

 
Reply to this topicStart new topic

loading .txt file into vb6

mike_heim
4 Dec, 2008 - 02:19 PM
Post #1

New D.I.C Head
*

Joined: 4 Dec, 2008
Posts: 3

hello im really new to programming and im basically trying to create a program where an item number it entered and the program will find the item from a list of ten items i have stored in a .txt file. the problem is i dont know how to load them into vb. i then had the idea to try and load them into a combo box from looking at a different topic on the forum but still i have no look so any help is welcome.

CODE
Private Sub Command1_Click()
Dim combo1 As ComboBox
Call LoadSC_item1(combo1)

End Sub



Private Sub item_Change()
Dim iFile As Integer
Dim item1() As String
Dim iItem As Integer

iFile = FreeFile

Open "I:\stocklist.txt" For Input As iFile

item1 = Split(Input$(LOF(iFile), iFile), vbCrLf)

Close iFile
    .Clear

    For iItem = 0 To UBound(sCDKeys)
         If Len(item1(iItem)) > 0 Then
            .AddItem item1(iItem)
         End If
    Next
      If .ListCount > 0 Then
         .ListIndex = 0
      End If
      
    End With
End Sub


This post has been edited by mike_heim: 4 Dec, 2008 - 02:29 PM

User is offlineProfile CardPM
+Quote Post


thava
RE: Loading .txt File Into Vb6
4 Dec, 2008 - 02:55 PM
Post #2

D.I.C Addict
Group Icon

Joined: 17 Apr, 2007
Posts: 670



Thanked: 35 times
Dream Kudos: 75
My Contributions
just follow the link
you need to know the use of input command

http://www.dreamincode.net/forums/showtopic29575.htm
User is offlineProfile CardPM
+Quote Post

born2c0de
RE: Loading .txt File Into Vb6
4 Dec, 2008 - 10:50 PM
Post #3

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 4,353



Thanked: 81 times
Dream Kudos: 2800
Expert In: J2ME, 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
Click here to Read my Tutorial on Sequential Files in VB6.

EDIT: Just realized thava had already posted the same link in his post. *oops*
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 7/4/09 06:37PM

Live VB Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month