Strings in textfiles

Find quick help here to get you started with Hollywood
Post Reply
TearsOfMe
Posts: 17
Joined: Fri Apr 24, 2020 2:15 pm

Strings in textfiles

Post by TearsOfMe »

Hello.
Can anyone tell me what i make wrong with this code.
I want to insert an string (a$,b$) in this file.

Code:
a$=files[0]
b$=files[1]

xml$="<dvdauthor>\n<vmgm />\n<titleset>\n<titles>\n<pgc>\n<vob file=\"..a$..\"/>\n<vob file=\"..b$..\"/>\n</pgc>\n</titles>\n</titleset>\n</dvdauthor>"
stringtofile (xml$, "dvd.xml")

Output:
<dvdauthor>
<vmgm />
<titleset>
<titles>
<pgc>
<vob file="a$"/>
<vob file="b$"/>
</pgc>
</titles>
</titleset>
</dvdauthor>


Greetz
Tears
User avatar
jPV
Posts: 603
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Strings in textfiles

Post by jPV »

You'll have to close strings before doing concatenation. \" doesn't close them, but inserts a double quote in the string, so you'll have to add couple real double quotes there.

This should work:
xml$="<dvdauthor>\n<vmgm />\n<titleset>\n<titles>\n<pgc>\n<vob file=\""..a$.."\"/>\n<vob file=\""..b$.."\"/>\n</pgc>\n</titles>\n</titleset>\n</dvdauthor>"
TearsOfMe
Posts: 17
Joined: Fri Apr 24, 2020 2:15 pm

Re: Strings in textfiles

Post by TearsOfMe »

Perfect.
Thank you.
Post Reply