• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

XMLVars Question

Messages
13
Country
unitedstates
hi, first of all, thanks to the creator of this great tool. i was wondering if there is a way to delete records, other than overwriting current records or using (>C:XMLVARS:Reset)
 
hi, first of all, thanks to the creator of this great tool. i was wondering if there is a way to delete records, other than overwriting current records or using (>C:XMLVARS:Reset)

I second your thoughts about Tom's module. I am positive he will also respond to your question, but I had the same question a few months ago.

You can erase individual XMLVars by writing a null string to them:

Code:
[COLOR="Green"]'XMLVAR_AnyName' (>C:XMLVARS:SearchVarName, string)[COLOR="Red"][B] '' [/B][/COLOR](>C:XMLVARS:StringValue, string)[/COLOR]

where '' is two single quotes with no space in between. Same works for number variables.

The example above first locates the index for XMLVAR_AnyName, and then writes '' to it. It does not store a zero or a space in the contents ... it erases the contents of XMLVAR_AnyName just as 1 (>C:XMLVARS:Reset) erases all of the XMLVARs. Just make sure you have the latest version of XMLVARs as the initial (beta maybe) version did not have this capability.

Hope this helps,

Bob
 
Last edited:
You can erase individual XMLVars by writing a null string to them:

Code:
[COLOR="Green"]'XMLVAR_AnyName' (>C:XMLVARS:SearchVarName, string)[COLOR="Red"][B] '' [/B][/COLOR](>C:XMLVARS:StringValue, string)[/COLOR]

where '' is two single quotes with no space in between. Same works for number variables.

The example above first locates the index for XMLVAR_AnyName, and then writes '' to it. It does not store a zero or a space in the contents ... it erases the contents of XMLVAR_AnyName just as 1 (>C:XMLVARS:Reset) erases all of the XMLVARs. Just make sure you have the latest version of XMLVARs as the initial (beta maybe) version did not have this capability.

Hope this helps,

Bob[/QUOTE]

Thanks, does that work on arrays too? or would it just delete the index and reorder them?
 
Thanks, does that work on arrays too? or would it just delete the index and reorder them?

Hi,

In simple terms, arrays are automatically managed by the module, so it is not necessary to reorder/reindex unless you need to delete/insert intermediate array records and keep them in sequence. In this case, you can take a look at XMLVarsexample.xml; there are a couple of macros showing the way (one at least) to deal with this kind of process.

Now, what Bob stated is correct; you can send '' to clear a variable's string content, or 0 to clear its numeric value; however the name (index) of the variable remains active. I am going to release an update soon that will allow to clear the variable slot as well, bringing the possibility to assign a new var name (index) and value(s) into that position. This could be very useful in case one needs to work with tables containing multiple rows and columns; then the space used by one table could be cleared and reused by another one, all within the limit of 1024 records in total.


Tom
 
Back
Top