OG Xbox Forums => Official MediaXMenu (MXM) Forum => Dashboard Forums => MXM ActionScripting Forum => Topic started by: Mordenkainen on November 26, 2003, 09:02:00 AM
Title: Writing Reserved Characters
Post by: Mordenkainen on November 26, 2003, 09:02:00 AM
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.
This post has been edited by Mordenkainen: Nov 26 2003, 05:07 PM
Title: Writing Reserved Characters
Post by: BenJeremy on November 26, 2003, 09:04:00 AM
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)
Title: Writing Reserved Characters
Post by: Mordenkainen on November 26, 2003, 09:08:00 AM
Thanks BJ!
You replied before I was even done editing out my mistakes!
Morden.
Title: Writing Reserved Characters
Post by: Mordenkainen on November 28, 2003, 10:50:00 AM
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.