[Gambas-user] Weird Characters in output files. ^X ^Q ^T etc.

Benoit Minisini gambas at ...1...
Sat Nov 8 01:43:25 CET 2008


On samedi 8 novembre 2008, Robert Moss wrote:
> Hi, Sorry to bug you again, once I get this down i'll be able to help you
> tackle this mailing list ^_^
> I open up a stream like so:
>
> Dim fh as File
> dim myObj as MyObject
>
> fh = Open FileName as OUTPUT CREATE
>
> for each myObj in MyGroup
>   WRITE #fh, myObj.Name & ":" & str(myObj.Count) & ":" & str(myObj.MaxSize)
> NEXT
>
> Close #fh
>
> and the resulting file ( via less file.txt) is:
>
> ^Uobjectname:4:10^Sobj2name:5:5^xlastobj:2:10
>
> now, i can understand if i have to append a \n to these, but what is with
> these "Special" characters preceeding my strings?

These are the length of the strings. Please read the documentation on the 
WRITE instruction: if you want to write the string contents without the 
length, use the optional length argument, or use the PRINT instruction.

Regards,

-- 
Benoit Minisini




More information about the User mailing list