Heretic
Resource contributor
- Messages
- 6,830
- Country

I need to pass two different strings (filenames) between two XML gauges for processing in Logger.
Let's call them "File_A.txt" and "File_B.txt".
From what I've read, handling strings via L: vars is a PITA and macros aren't processed across XML gauges.
So I'm looking at XMLVars as a solution.
The code in gauge #1 contains the strings to be processed by XMLVars.
In gauge #2, the strings are then to be used for Logger's save/load capabilities.
The syntax examples in XMLTools.pdf are not quite clear on how to make this work for multiple strings and my example above doesn't work in FSX.
Any idea, Tom (or Robbie)?
(Cue thread marked solved and edit with a solution in 3...2...)
- Edit:
Called it!
Associate a variable with every string you want to save and then simply call the string from a macro. Let Logger process the result of said macro and everything will be fine and dandy.
Gauge #1:
Gauge #2:
Let's call them "File_A.txt" and "File_B.txt".
From what I've read, handling strings via L: vars is a PITA and macros aren't processed across XML gauges.
So I'm looking at XMLVars as a solution.
The code in gauge #1 contains the strings to be processed by XMLVars.
Code:
'File_A.txt' (>C:XMLVARS:StringValue1,string)
'File_B.txt' (>C:XMLVARS:StringValue2,string)
In gauge #2, the strings are then to be used for Logger's save/load capabilities.
Code:
(C:XMLVARS:StringValue2,string) (>C:LOGGER:openRead)
...
(C:XMLVARS:StringValue1,string) (>C:LOGGER:openRead)
...
...
(C:XMLVARS:StringValue1,string) (>C:LOGGER:openWrite)
...
(C:XMLVARS:StringValue2,string) (>C:LOGGER:openWrite)
The syntax examples in XMLTools.pdf are not quite clear on how to make this work for multiple strings and my example above doesn't work in FSX.
Any idea, Tom (or Robbie)?
(Cue thread marked solved and edit with a solution in 3...2...)
- Edit:
Called it!
Associate a variable with every string you want to save and then simply call the string from a macro. Let Logger process the result of said macro and everything will be fine and dandy.
Gauge #1:
Code:
'First File' (>C:XMLVARS:StoreVarName,string)
'File_A.txt' (>C:XMLVARS:StringValue,string)
'Second File' (>C:XMLVARS:StoreVarName,string)
'File_B.txt' (>C:XMLVARS:StringValue,string)
Gauge #2:
Code:
<Macro Name="A">'First File' (>C:XMLVARS:SearchVarName,string) (C:XMLVARS:StringValue,string)</Macro>
<!-- Pick a filename for the company's save file! -->
<Macro Name="B">'Second File' (>C:XMLVARS:SearchVarName,string) (C:XMLVARS:StringValue,string)</Macro>
...
...
...
@B (>C:LOGGER:openRead)
@A (>C:LOGGER:openRead)
...
@A (>C:LOGGER:openWrite)
@B (>C:LOGGER:openWrite)
Last edited:
