Hi
A quick question: How can I convert a simple Text from QBasic into Unicode and safe it in a file?
Thanks
FatalError
Convert simple text into Unicode?
Moderators:Administrator, Global Moderator
Re: Convert simple text into Unicode?
if u mean to convert .txt format text to unicode (by that i assume u mean uncoded text, on my computer unicode extonsion is TXT it might be diffrent on yours) then it's really simple.
u open the file for output and then u open a new file for
input and save it in there. u do it like this:
that opens the file and then this writes it to a new file:
i think that should do the trick ;)
u open the file for output and then u open a new file for
input and save it in there. u do it like this:
Code: Select all
OPEN "file1.TXT" FOR INPUT AS 1
INPUT#1,var$
CLOSE#1
Code: Select all
OPEN "file2.TXT" FOR OUTPUT AS 2
WRITE#2,var$
CLOSE#2
Re: Convert simple text into Unicode?
Yes, it runs!
But now I have a new problem:
Any Line in the file begins and ends with a >"<
What can I do against this?
But now I have a new problem:
Any Line in the file begins and ends with a >"<
What can I do against this?
Re: Convert simple text into Unicode?
well u can't remove the >"<'s from the file but you can display the file withuout them. u do something like this
let var2$=mid$(var1$,3,varLEN) 'var1=file varLEN=last character of the file
let var2$=mid$(var1$,3,varLEN) 'var1=file varLEN=last character of the file
-
- QBasic God
- Posts:166
- Joined:Tue Mar 25, 2003 12:45 am
- Location:U.S.A.
- Contact:
Here it is guys...
Code: Select all
CLS
A$ = "Dr_Davenstein Rules!"
FileNumber = FREEFILE
OPEN "Myfile.myf" FOR OUTPUT AS FileNumber
PRINT #FileNumber, A$
CLOSE FileNumber
OPEN "Myfile.myf" FOR INPUT AS FileNumber
INPUT #FileNumber, B$
CLOSE FileNumber
PRINT B$
KILL "MyFile.Myf"
...And here is a screenshot of my latest QB game,Pacenstein! It might take a second to download.
http://www.QBNZ.com/dr_davenstein/Pacenstein.zip
Come check out [url=http://www.freebasic.net/forum/index.php]FreeBASIC[/url]. The syntax is based on QuickBasic, but it expands to use pointers, operator overloading, etc... The list goes on and on!