Sign in to follow this  

Recommended Posts

The variable (A:GPS WP NEXT ID,string) shows the ID of this waypoint as a string of letters (e.g. EGSS). Is it possible to check the ID of the next WP against a given, and if true to associate an action to it. e.g.:------------------------------------------- (A:GPS WP NEXT ID,string) EGSS == if{-------------------------------------------but I cannot get it to work.Your help is very appreciated!Servus from ViennaErnestus

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

I'm not certain that XML offers the equivalent of a strcmp (string compare) function, but of of the oddities of that function is that it returns a ZERO if true, not a ONE...

Share this post


Link to post
Share on other sites

This should work:(A:GPS WP NEXT ID,string) 'EGSS' scmp !if{ }As Bill said, note the funny thing with stringcompare: it returns "0" when strings are equal, "1" when not equal.Not very logical indeed ..LOLCheers, Rob Barendregt

Share this post


Link to post
Share on other sites

Thanks, Rob... Now that you mention it, I do remember seeing that in some XML code once or twice... ;)As for the "0" return, it makes perfect sense when you consider that after expanding the C function, you find that it is simply subtracting the numeric values of the two strings! Of course it will be zero if they are equal! ;)On another note Rob, how would having the ability to convert your XML code to an encrypted binary format sit with you? I've been looking at some possibilities, and that seems to be the most likely to be "doable."

Share this post


Link to post
Share on other sites

Hi Bill,Yes, I understand why the FS StringCompare gives the result is does; but that doesn't make it logical behaviour from a programmer's perspective, does it :-) ??About the encription: yes, I'm certainly interrested in such a thing. If only how you would solve the problem of letting FS load an encripted XML file with real-time decription. Unless you had a .xml --> .gau conversion in mind ?Regards, Rob

Share this post


Link to post
Share on other sites

>Hi Bill,>>Yes, I understand why the FS StringCompare gives the result is>does; but that doesn't make it logical behaviour from a>programmer's perspective, does it :-) ??Agreed! I got caught with my "pants around my ankles" the first time around with this myself... ;)>About the encription: yes, I'm certainly interrested in such a>thing. If only how you would solve the problem of letting FS>load an encripted XML file with real-time decription. >Unless you had a .xml --> .gau conversion in mind ?I'm still in the "what if" stage, but it should be possible to insert a wedge inbetween the sim engine and the .cab file to decrypt the binary xml code on panel load or connect to window.But, who knows? Maybe something will come from this speculation, maybe not... ;)

Share this post


Link to post
Share on other sites

Bill,Your idea sounds more than interesting. However, at first sight it might be something difficult to achieve.The .cab could be decrypted when panel load process starts, and encrypted again before it ends.But if load is aborted, .cab would stay decrypted and therefore open to everybody?Just a thought :-)Tom

Share this post


Link to post
Share on other sites

Er, nope. The basic idea is to simply decrypt on panel load to memory. No 're-encryption' would be necessary at all. IOW, no change would occur to the source .cab file at all, and whatever occurs would be totally transparent to the user.

Share this post


Link to post
Share on other sites

That "basic" idea to me is a great idea.Please accept me as the first customer of your (dll?) :-)Tom

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this