October 29, 200520 yr 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
October 29, 200520 yr Moderator 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
October 29, 200520 yr 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
October 29, 200520 yr Moderator 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
October 30, 200520 yr 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
October 30, 200520 yr Moderator >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
October 30, 200520 yr Author 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
October 31, 200520 yr Moderator 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
October 31, 200520 yr Author That "basic" idea to me is a great idea.Please accept me as the first customer of your (dll?) :-)Tom
Create an account or sign in to comment