Примеры программ на языке QBASIC

DECLARE SUB TOWIN (TO1251() AS INTEGER)
DIM TO1251(256) AS INTEGER
INPUT "Задайте имя файла - ", SOURCE$
TOWIN TO1251()
OPEN SOURCE$ FOR INPUT AS #1
OPEN "TMPWIN.TXT" FOR OUTPUT AS #2
DO WHILE NOT EOF(1)
   LINE INPUT #1, A$
   FOR J = 1 TO LEN(A$)
     MID$(A$, J, 1) = CHR$(TO1251(ASC(MID$(A$, J, 1))))
   NEXT J
PRINT #2, A$
LOOP
CLOSE 1, 2
END

SUB TOWIN (TO1251() AS INTEGER)
FOR J = 0 TO 127: TO1251(J) = J: NEXT J
FOR J = 128 TO 175: TO1251(J) = J + 64: NEXT J
FOR J = 176 TO 223: TO1251(J) = ASC("+"): NEXT J
TO1251(179) = ASC("|")
TO1251(186) = ASC("|")
TO1251(196) = ASC("-")
TO1251(205) = ASC("=")
FOR J = 224 TO 239: TO1251(J) = J + 16: NEXT J
TO1251(240) = 168:      ' Заменяем код буквы "ё"
TO1251(241) = 184:      ' Заменяем код буквы "Ё"
END SUB