Help - Search - Members - Calendar
Full Version: Writing Reserved Characters
Scenyx Entertainment Community > Xbox1 Forums > Dashboard Forums > Official MediaXMenu (MXM) Forum > MXM ActionScripting Forum
Mordenkainen
I have been trying to write a script that uses the file operations (Not the xml ones, though I will also want to use those in the future). The issue I have is I am writing a little piece of script out to the file. Since it is an actionscript it has %'s and "'s and such all over the place. These characters do not seem to get written to the output file even if I double them up...

Examples:

writefileln "Test %test%"

Outputs:
Test
(This is expected as %test% is undefined)

writefileln "Test %%test%%"

Outputs:
Test %

Where did the rest of the text go?

Just to try stuff I tried:
"Test \%test\%"
"Test %%%test%%%"

and several other combinations, none worked....

Though:
writefileln "Test %test"

Did output:
Test %test

but:
writefile "Test %test"
writefile "%"

Output:
Test %test
%
(see my note below)


As this is Actionscript I am outputting I will need to be able to write out these characters. As well as a few others..

Also as I side note, I noticed that WriteFileLN and WriteFile do the same thing, both put a newline on the end, so:

WriteFile "Test"
WriteFile "ing"

Outputs:
Test
ing

as opposed to "Testing" as the documentation would suggest.

Can anyone help me out here?

Morden.
BenJeremy
I'll have to check into that... lucky for you guys I've got a long weekend with no travel plans (well, except for Thanksgiving day itself)
Mordenkainen
Thanks BJ!

You replied before I was even done editing out my mistakes!

Morden.
Mordenkainen
Ok here is what I have figured out so far:

Doubling up % it " in a string doesn't seem to work, The string usually gets terminated at the doubled character.

I have tried several other ways to assign " characters to a string (preceding with \ etc.). % can be assigned as long as there are not two of them surrounding text (I.E. %text%)

If you load a character from a file (say a file that only has one line: "), you can then use that variable in place of the character. This works but is an ugly hack.

CODE

 openread testfile e:\mxm\test.txt
 readfileln testfile testvar
 closefile testfile
 set testvar "%testvar%test%testvar%"
 callscript _displaymessagebox %testvar%


Hope this helps!

Morden.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.