|
-
February 10th, 2000, 07:22 AM
#1
Binary data
How can I handle binary data in Visual Basic.
Reading binary data from a file and dumping it
to a serial com port.
-
February 10th, 2000, 08:47 AM
#2
Re: Binary data
You can read data from a file into a Byte Array by using the 'Open for Binary Access...' commands when opening a file,
eg
Dim bByt() as Byte
Dim iFile as Integer
'
iFile = FreeFile
'
Open "c:\test.dat" for binary Access Read as iFile
'
get #iFile, , bByt
'
Close #iFile
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
-
February 10th, 2000, 08:55 AM
#3
Re: Binary data
'Something along these lines, use MSCOMM32.OCX
'MSComm1 setup here
MSComm1.PortOpen
Open "c:\joe.txt" For Binary Access Read As #1
While Not EOF(1)
Line Input #1, foo$
MSComm1.Output foo$
Close #1
Wend
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|