• 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.

Using String Storing macros

Messages
1,564
Country
thailand
Following up on discussion of the use of sting storing macros in this FSDeveloper thread (http://www.fsdeveloper.com/forum/showthread.php?t=157527) (see post 19 onwards), the attached XML gauge demonsrates use of the macros when entering text from either the pc keyboard, or using mouse clicks on a simulated FMS gauge keyboard. Credit and thanks to Tom Aguilo and Joao Muas for their work and solutions.

The attached gauge is fully functional, written using FS9 syntax but also useable in FSX, and intended to be set up as a separate x=245, y=270 windowed gauge for demo purposes. Instructions are included in the gauge.

The topic of storing strings is discussed in the FSDeveloper Wiki (http://www.fsdeveloper.com/wiki/index.php?title=Xml:_storing_strings) and in this thread http://www.fsdeveloper.com/forum/showthread.php?t=94088. There are several approaches to storing strings, including excellent solutions provided by Doug Dawson, Roman Stoviak, and Robbie McElrath, among others. The attached XML gauge uses Robbie McElrath's macros that can be used to store string data up to 64 characters long as a "single" L:Var.

L:Vars can only store numbers, not strings, so the ascii equivalent of the character is used. Behind the scenes, the macros actually construct sixteen L:Vars containing 4 alphanumeric characters each by utilizing the ascii hexadecimal value of each character together with XML's built in Bit Operators (>>, <<, |, &) to keep track of the order. &lt;&lt; and &amp; are used instead of << and & to keep the XML parser happy. The Read4, Write4, etc.. macros each create 4 L:Vars, and the Read macros just expand to 4 copies of the name4 macros, which gives 16 total. The L:Vars are subsequently concatenated using XML String Operators chr and scat to form a string up to 64 characters long.

The user chooses an arbitrary name which is attached to the 16 L:Vars as a prefix, uniquely labeling them (name_[1-4]_[1-4]). The 16 building block L:Vars are never shown individually, and just one L:Var name (prefix) is entered. To the user, the appearance is that a single L:Var holds a string up to 64 alphanumeric characters long.

Cheers,

Bob
 

Attachments

  • StringMacroExample2.xml
    StringMacroExample2.xml
    29.6 KB · Views: 510
  • StringStoreDemo.jpg
    StringStoreDemo.jpg
    41.3 KB · Views: 437
Last edited:
Very clear and precise. Thank you. Works ok in FSX.
Personaly, I don't see why can't both, keyboard and mouse click input be "on" all the time, it wroks ok that way to.

Next I'd be glad to see how to handle a file for saved flight plan titles.
I understood the solution but I'm still struggling to put it on practice.

Thanks again for this tools and support.
 
I don't see why can't both, keyboard and mouse click input be "on" all the time, it works ok that way to.

If pc direct keyboard entry is constantly enabled, then you will lose the normal keyboard assignments, like "G" for landing gear toggle, etc.

Bob
 
Unfortunately, for some reason the board is throwing a hissy fit when trying to d/l the .xml file: "Database Error..." :mad:
 
If pc direct keyboard entry is constantly enabled, then you will lose the normal keyboard assignments, like "G" for landing gear toggle, etc.

Bob
Of course, I didn't thought of that.
In fact that didn't hapened to me because only certain pages of my FMS will allow user input under some circunstances, so most of the time my keyboard/mouse entries are "closed" so there is no trapping for controls.
But that's a good point you got there, that surely deserves some atention.

Unfortunately, for some reason the board is throwing a hissy fit when trying to d/l the .xml file: "Database Error..." :mad:
Didn't happen to me...
 
But that's a good point you got there, that surely deserves some atention.

Credit here goes to Roman Stoviak. If I remember correctly, he is the one who pointed this out to me. Having said that, I believe Roman was discussing some shift register code that Arne Bartels had published, so credit might really belong to Arne!
 
Do I need to re-upload?

I finally managed to get it. It was the server/board software/latency that was causing the problem. After about 20 tries, it finally completed.

I was also having problems posting message yesterday as well. Just the one above took a dozen attempts over a twenty minute period! :eek:
 
Arno was apparently having trouble with his server yesterday. All appears OK today...
 
Back
Top