Getting first two chars of bulk text
Hey,
I'm looking for a way to convert big amounts of hex and format them into Chr$("&H00") for example.
I have no idea how to achieve this... I'm guessing that I would need to loop through the entire text, extracting the first two characters, adding the Chr$("&H"" & extractedbit & """)"". I also need it to ignore spaces. I hope this makes sense.
For example say I have this: 3a ec 20 00
I want it to change to this: Chr$("&H3a") & Chr$("&Hec") & Chr$("&H20") & Chr$("&H00").
I'm also using Gambas.
Thanks for any help, sorry if that sounds confusing.
Re: Getting first two chars of bulk text
Basically:
For i = 1 To Len(text) Step 3
Output Chr$(", the character at i, the character at i+1, ), space, & and space
Next i
The exact syntax depends on the type of Basic.