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

lawrence pires piresl at ...626...
Tue Dec 25 12:32:15 CET 2007


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



More information about the User mailing list