PDA

Click to See Complete Forum and Search --> : Convert Hex string Challenge


3_trinity_3
Sep 28th, 2000, 02:32 PM
I don't even know if this is possible using VB, but here is something that I know would be useful.
Automatically (by command line) open a file
Find a single hex value (or a string of hex) depending on the command line switch
Convert each occurrence of the hex value (or string) to a different value
Save the file with the same name
While this could be done using a text editor quite easily, that requires user input. A distributable component can be called in the middle of a transformation from one input format on the fly would be useful. For example: UNIX to DOS, if a delimiter is a “non-printable, non-viewable” character, or if a delimiter like (’) as in O’Leary would cause an exception during processing.

If anyone has any ideas, I would like to see them.

Thanks
Shawn McCullough

HarryW
Oct 2nd, 2000, 11:40 PM
I don't know how to get command line parameters in VB, but what you're suggesting isn't that hard. In fact the code for it already exists in VB6, in the Replace function. If you don't have VB6 then you can easily write your own version in 10-15 lines of code.