Jump to content
Sign in to follow this  
Guest rkruijer

String operations

Recommended Posts

Guest rkruijer

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
Guest rkruijer

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  

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