Jump to content
Sign in to follow this  

Recommended Posts

Guest ernestus

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

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


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest ernestus

Thanks a lot! It works.Servus from ViennaErnestus

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... ;)


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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.


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...