Sign in to follow this  
Guest furledd

XML String functions sstr and ssub - how to use?

Recommended Posts

I am going to have to give up looking and ask you folks on this..I am outputting a frequency name to my GPS gauge:(@c:WaypointAirportFrequencyName, string) )%!s!How can I only take the first 4 characters - writing out APPROACH and DEPARTURE is too long. !4s! specifies minimum characters to print of course so that wont work. I kludged together a Formatted Text spec with a short X value to clip it but thats a crappy solution.I see in XML SDK they mention lc Converts a string to lowercase.uc Converts a string to uppercase.cap Capitalizes a string.chr Converts a number to a symbol.ord Converts a symbol to an integer.scat Concatenates strings.schr Finds a symbol in a string.scmp Compares strings.scmi Compares strings, ignoring case.sstr Finds a substring.ssub Extracts a substring.symb Extracts a single character.I cant find any examples of many of the lower functions whats the arguments to make them work?Does (@c:WaypointAirportFrequencyName, string) 4 1 ssub for example, would that extract first 4 characters starting with 1 I didnt find any examples in the GPS eitherAnyone have a key on using these?help!ThanksDwight

Share this post


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

Hi,I am looking for some answers on this subject as well.Did you succeed in your search for the use of these functions elsewhere?Roelof

Share this post


Link to post
Share on other sites

AFAIK, FS9 XML won't allow strings in variables. If you've found some way around that, you're already ahead of me.Because of this limitation, I can't even begin to think of how to do ops on strings without using any variables... unless you wanted to code for every possibility but that certainly wouldn't work.Scott / Vorlin

Share this post


Link to post
Share on other sites

>AFAIK, FS9 XML won't allow strings in variables. If you've>found some way around that, you're already ahead of me.>>Because of this limitation, I can't even begin to think of how>to do ops on strings without using any variables... unless you>wanted to code for every possibility but that certainly>wouldn't work.>>Scott / VorlinHello Scott,That seems to be correct but:(@c:NearestAirportCurrentIdent,string) 'EHAM' scmp ! if{ 3000 (>L:AP,number) } This compare function works! So even if you are not able to enter the string into an L:var you do have some ability to work with them.(@c:NearestAirportCurrentIdent,string) 'EH' sstr ! if{ 3000 (>L:AP,number) } also works. Note the "!". XML seems to have most of it upside down! (-:If you need to print it you could use something like: (L:AP,number) 3000 == EHAMI know it is primitive but it may give you a lead... Roelof

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