|
-
Jul 18th, 2000, 10:25 PM
#5
Hyperactive Member
Hmmm
Well it looks to me like you are attempting to read binary data however you are attempting to place this in a text box which won't let you see all the data.
Is that your intention?
kedaman's code works perfecty given the assumption that you are transferring text between the file and the text box. You said that it only shows the first three characters? Well that's because the fourth character is a 0 in your file.
Notepad handles the character 0 more cleverly by assuming you want to see as much of the file as possible, so it places a space where the chr(0) was. Just try opening your file in notepad, then saving it off as another name and see if it still works. You will find it doesn't. Furthermore, if it is an executable as your example suggestes, it may crash your system.
So I think you must decide what you want to do about these non ASCII characters. If you want them replaced with something meaningful (like a space) and then put in your text box, then you will have replace each of these characters after initially reading in the string.
If you think you will be able to change anything in the file and save it again without corrupting it...you better think again. As soon as you change those chr(0)'s to something else, you have ruined your chances of saving the file as it was.
Are you trying to make a Hex editor or something?
Regards
Paul Lewis
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
|