Page 1 of 1

Inserting null characters

Posted: Thu Sep 29, 2005 2:07 am
by Martin E
I actually use VBDOS, but I do not avail myself of the "V", functions at all, so I essentially program in QuickBasic. I am trying to convert an ASCII text file to Unicode. To do so, in a text string besides the inital hex characters of FF and FE, every ASCII character has to be preceded by a null (00) character to make it double-width. Using the ususal Basic MID$ and "+" functions, I cannot add any more characters after the first (00), the string refuses to be concatenated any further. Is this a peculiarity of VBDOS or does QBasic/QuickBasic also experience it? If so, is there a workaround?

Posted: Thu Sep 29, 2005 6:54 pm
by Quibbler
Doesn't seem to be any problem in qbasic

Code: Select all

a$="ABCDE"
for i=1 to 5
b$=b$+chr$(0)+mid$(a$,i,1)
next i