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

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




Open File Dialouge Help

 
Reply to this topicStart new topic

Open File Dialouge Help, Reading one line at a time in a wordpad document

CanadaRules
22 Nov, 2006 - 12:21 PM
Post #1

New D.I.C Head
*

Joined: 15 Nov, 2006
Posts: 10


My Contributions
ok i have a store cash register program that i am making. The "items" that are available in the store have 3 things, which are in a wordpad document in this fashion:

1. A 3 number UPC code
2. A description (i.e. Pencil, or potatos)
3. A price

THE ACTUAL DOCUMENT LOOKS LIKE THIS: there is one characteristic of the item on one line..........



001 (upc)
Mashed Potatos (the item descritpion)
1.50 (the price)
002
Turkey
4.00
003
Pop Tarts
2.00
004
Pencil
.99


and so on for all the items.......

Now, in this program, i am typing a 3 digit numeber upc code into a text box and searching if that upc exists in the wordpad document.

If it does i want it to ONLY display the item description and the price for ONLY that particulat UPC that the user typed in the text box. I have it so far where its displaying EVERYTHING though. I want it to display only the 2 items (description and price) for the UPC that was typed in...........

so if u type in "001" i want it to display this: Mashed Potatoes.........................$1.50
with the dots and everyting. This is what i have and its displying EVERYTHING instead of one item:

CODE

infile = New StreamReader("C:\products.dat")
While infile.Peek() >= 0
UPCLine = infile.ReadLine
Label1.Text &= UPCLine & vbNewLine
        End While
        infile.Close()


what am i missing to make it disply only that item that you typed the upc code in for? And I have to be able to type in another one after that and add it to the list (including the same upc i just did if i wanted to)

This post has been edited by CanadaRules: 22 Nov, 2006 - 12:23 PM
User is offlineProfile CardPM
+Quote Post

KeyWiz
RE: Open File Dialouge Help
23 Nov, 2006 - 08:56 AM
Post #2

D.I.C Regular
Group Icon

Joined: 26 Oct, 2006
Posts: 428


Dream Kudos: 125
My Contributions
QUOTE(CanadaRules @ 22 Nov, 2006 - 01:21 PM) *

ok i have a store cash register program that i am making. The "items" that are available in the store have 3 things, which are in a wordpad document in this fashion:

1. A 3 number UPC code
2. A description (i.e. Pencil, or potatos)
3. A price

THE ACTUAL DOCUMENT LOOKS LIKE THIS: there is one characteristic of the item on one line..........



001 (upc)
Mashed Potatos (the item descritpion)
1.50 (the price)
002
Turkey
4.00
003
Pop Tarts
2.00
004
Pencil
.99


and so on for all the items.......

Now, in this program, i am typing a 3 digit numeber upc code into a text box and searching if that upc exists in the wordpad document.

If it does i want it to ONLY display the item description and the price for ONLY that particulat UPC that the user typed in the text box. I have it so far where its displaying EVERYTHING though. I want it to display only the 2 items (description and price) for the UPC that was typed in...........

so if u type in "001" i want it to display this: Mashed Potatoes.........................$1.50
with the dots and everyting. This is what i have and its displying EVERYTHING instead of one item:

CODE

infile = New StreamReader("C:\products.dat")
While infile.Peek() >= 0
UPCLine = infile.ReadLine
Label1.Text &= UPCLine & vbNewLine
        End While
        infile.Close()


what am i missing to make it disply only that item that you typed the upc code in for? And I have to be able to type in another one after that and add it to the list (including the same upc i just did if i wanted to)

Are you working in VB6 or VB2005?

User is offlineProfile CardPM
+Quote Post

CanadaRules
RE: Open File Dialouge Help
23 Nov, 2006 - 06:45 PM
Post #3

New D.I.C Head
*

Joined: 15 Nov, 2006
Posts: 10


My Contributions

[/quote]
Are you working in VB6 or VB2005?
[/quote]



VB 2005

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/4/08 06:55PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month