Δευτέρα 18 Οκτωβρίου 2021

Revision 28 Version 10

 Fix for Show$() and Hide$(), for odd byte length of strings. Normally a string has even number of bytes (UTF-16LE encoded). But we can store ANSI one byte per character, using Str$(string expr), and convert back to UTF16LE using CHR$(string expr). The locale id for conversions used as read only variable Locale indicate. We can use Locale statement to change the ANSI type of conversion. Locale used when we read strings from text files when ANSI mode used.

print Len("GEORGE KARRAS THE BEST!")*2 ' 46 bytes
a$=str$("GEORGE KARRAS THE BEST!") ' convert to ANSI encode 1 byte.
print LEN(a$)*2 ' 23 bytes
b$=hide$(a$,"Alfabeta", 555)
print len(b$)*2 ' 45 bytes
z$=show$(b$,"Alfabeta", 555)
print len(z$)*2 ' 23 bytes
// convert to UTF16LE
print chr$(a$) ' GEORGE KARRAS THE BEST!
print chr$(z$) ' GEORGE KARRAS THE BEST!
// previous version:
// print chr$(z$) return "GEORGE KARRAS THE BEST" missing "!", 22 bytes.
print len(z$) *2 ' 23 bytes
k$=chr$(z$)
print len(k$)*2 ' 46 bytes

Δεν υπάρχουν σχόλια:

Δημοσίευση σχολίου

You can feel free to write any suggestion, or idea on the subject.