January 24, 200620 yr 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
March 30, 200620 yr 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
March 30, 200620 yr 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
March 31, 200620 yr >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
Create an account or sign in to comment