[Gambas-user] Write to file is adding strange characters

Daniel Campos dcamposf at ...626...
Tue Dec 25 14:32:45 CET 2007


WRITE #hFile, test,Len(test)

or

PRINT #hFile,test

A file buffer does not need to be flushed prior to close it.

Daniel

2007/12/25, lawrence pires <piresl at ...626...>:
> Im trying to automate the writing of a dvd.xml file.
>
> Im trying to create and write the following text into a file:
>
>  <dvdauthor>  <vmgm />    <titleset>      <titles>        <pgc>
>   <vob file="your_video.mpg" chapters="0,0:20,0:30,0:40,0:50,0:60" />
>       </pgc>      </titles>    </titleset></dvdauthor>
>
>
> Heres the code im using:
>
> PUBLIC SUB Button2_Click()
> DIM hFile AS File
> DIM test AS String
> DIM test1 AS String
> DIM test3 AS String
>
> test = "<dvdauthor> \n<vmgm /> \n<titleset>\n<titles>\n<pgc>\n"
> test1 = "<vob" "file=\"your_video.mpg\""
> "chapters=\"0,0:20,0:30,0:40,0:50,0:60\"" "/>"
> test3 = "\n</pgc>\n</titles>\n</titleset>\n</dvdauthor>"
>
> hFile = OPEN "/home/don/Desktop/dvd" FOR CREATE
>
> WRITE #hFile, test
> WRITE #hFile, test1
> WRITE #hFile, test3
> FLUSH #hFile
> CLOSE #hFile
> END
>
> And this is the contents after the above has been executed:
>
> 1<dvdauthor>
> <vmgm />
> <titleset>
> <titles>
> <pgc>
> @<vobfile="your_video.mpg"chapters="0,0:20,0:30,0:40,0:50,0:60"/>*
> </pgc>
> </titles>
> </titleset>
> </dvdauthor>
>
>
> As you can see is writing strange characters to the dvd.xml file.
>
>
> can anyone please help me?
>
> Kind regards & Happy Christmas
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>




More information about the User mailing list