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,508 people online right now. Registration is fast and FREE... Join Now!




Function and Reading One Line at a time

 
Reply to this topicStart new topic

Function and Reading One Line at a time

zygote
26 Nov, 2006 - 02:55 AM
Post #1

New D.I.C Head
*

Joined: 26 Nov, 2006
Posts: 1


My Contributions
Hi,

What I am trying to do is hard for me to explain (not the best at explaining things in typed words). What I want to do is:

1. Read One line in a Text file which looks like this.

255
147
159
248

2. Save that as a Variable so that I can use it in the following code

CODE

Private Declare Sub PortOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Byte)

Dim svdvariable As Interger

**CODE NEEDED TO GET VARIABLE FROM FILE**

Portout (888, svdvariable)



OK what the above code does is, it takes a decimal value and sends it to a .dll which then processes the value.

The variable that was saved would be named "svdvariable".

The Code would then go on to wait 100 milliseconds and then it would run again, but of course, reading the next line in the Text File. So The whole app's code would look something like this:

[code]
Private Class
Private Declare Sub PortOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Byte)

Dim svdvariable As Interger

**CODE NEEDED TO GET VARIABLE FROM FILE**

Private Sub

Portout (888, svdvariable)

End Sub
End Class
[\code]

Now I think the best way would be to use a function to save the variable from the text file, but I only know limited knowledge of coding and I don't know how to read one line from the text file and so on.

If anyone could help, That would be great

Thanks
User is offlineProfile CardPM
+Quote Post

CanadaRules
RE: Function And Reading One Line At A Time
26 Nov, 2006 - 06:32 PM
Post #2

New D.I.C Head
*

Joined: 15 Nov, 2006
Posts: 10


My Contributions
if you want to read one line at a time you need to declare a stream reader first then type in the correspinding code to read it line by line.
User is offlineProfile CardPM
+Quote Post

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

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