|
-
Jan 15th, 2000, 01:52 AM
#1
Thread Starter
Addicted Member
How can i open a file ascii???
-
Jan 15th, 2000, 01:56 AM
#2
Fanatic Member
Huh??
Open "C:\file.txt" for input as #1
?????
-
Jan 15th, 2000, 02:00 AM
#3
NEVER use #1...
Code:
dim MyFile as byte
Myfile = freefile
open "whatever" for append as #myfile
'add stuff to file
close #myfile
note: do not declare "Freefile"
-
Jan 15th, 2000, 03:40 AM
#4
Thread Starter
Addicted Member
how can i open it in binary adn show the binary in a textbox with out it getting a error like it does to me and 2 how can i opened a file in hex and dec
-
Jan 15th, 2000, 03:43 AM
#5
Fanatic Member
You'll have to open it in binary, and then convert it to Hex
-
Jan 15th, 2000, 03:47 AM
#6
Lively Member
What would be the code to do this?
-
Jan 15th, 2000, 03:56 AM
#7
Fanatic Member
Prolly sumptin like:
Code:
Dim MyFile as byte
Dim i as integer
Dim strBin as string
Open "whatever" for binary as MyFile
For i = 1 to LOF(MyFile)
Get MyFile, i, strBin
Text1 = Text1 & strBin
strBin = Hex(Asc(strBin))
Text2 = Text2 & " " & strBin
Next
Close MyFile
I dunno 
------------------
r0ach(tm)
-
Jan 15th, 2000, 04:19 AM
#8
Thread Starter
Addicted Member
here what i did and it not working look
Code:
Private Sub Form_Load()
Dim MyFile As Byte
Dim i As Integer
Dim strBin As String
Dim B
CommonDialog1.ShowOpen
Open CommonDialog1.filename For Binary As MyFile
For i = 1 To LOF(MyFile)
Get MyFile, i, strBin
Text1 = Text1 & strBin
strBin = Hex(Asc(strBin))
Text2 = Text2 & " " & strBin
Next
Close MyFile
End Sub
-
Jan 15th, 2000, 04:36 AM
#9
Fanatic Member
Oops, my mistake.
You should put
MyFile = freefile
before opening the file. sorry
------------------
r0ach(tm)
-
Jan 15th, 2000, 04:44 AM
#10
Thread Starter
Addicted Member
i just got a voer flow on
For i = 1 To LOF(MyFile)
-
Jan 15th, 2000, 05:01 AM
#11
-
Jan 15th, 2000, 05:19 AM
#12
Thread Starter
Addicted Member
now im getting a invaild call or arugment on
strBin = Hex(Asc(strBin))
-
Jan 15th, 2000, 05:37 AM
#13
Fanatic Member
Works for me!
What's the value of strBin, when you get the error??
-
Jan 15th, 2000, 05:54 AM
#14
Thread Starter
Addicted Member
-
Jan 15th, 2000, 06:19 AM
#15
Fanatic Member
change
Dim strBin As String
to
Dim strBin As String * 1
be prepared to wait a while though
------------------
r0ach(tm)
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
|