Sign in to follow this  
Guest rkruijer

String operations

Recommended Posts

Example of slen: (Not mentioned in the panel SDK)(@c:WaypointAirportRunwayDesignation) slen (>L:length,number) Works! It will return 7 for '01L-19R'Now I want to search for the symbols 'L', 'R' and/or 'C' To find character in a string the syntax is said to be schr, so I tried: ( runway 0 selected! in EHAM 01L-19R ) (@c:WaypointAirportRunwayDesignation,string) 'L' schr if{ 1 (>L:RwayTag,enum) } . (@c:WaypointAirportRunwayDesignation,string) 'R' schr if{ 2 (>L:RwayTag,enum) } . (@c:WaypointAirportRunwayDesignation,string) 'C' schr if{ 3 (>L:RwayTag,enum) } (L:RwayTag,enum) always becomes 3 even if there is no C in 01L-19R I also tried it with ! which works perfectly for (@c:NearestAirportCurrentIdent,string)'EH' sstr ! if{ 3000 } (@c:WaypointAirportRunwayDesignation,string) 'L' schr ! if{ 1 (>L:RwayTag,enum) } . (@c:WaypointAirportRunwayDesignation,string) 'R' schr ! if{ 2 (>L:RwayTag,enum) } . (@c:WaypointAirportRunwayDesignation,string) 'C' schr ! if{ 3 (>L:RwayTag,enum) } Here (L:RwayTag,enum) always stays 0 which would imply that none of the conditions is true Have the following schr, symb or ssub ever been tried succesfully?If so, I would be pleased to know how!Roelof

Share this post


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

Since there were no answers I did some digging.This is how it works:(@c:WaypointAirportRunwayDesignation) 'R' ord schr (>L:Found,number)Given the designation being '01L-19R'When not found it returns -1, when found it returns the position in the string starting with zero! 'L' wil return 2 and 'R' will return 6. How's that for an elegant solution.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