With one of your post and the doc i almost got everything working ! (i'm surprised myself lol).
Here is the problem :
For example we take 2 planets : SO-me-Thing A 1 and SO-me-Thing A 1 a.
Their gravity is stored in a list when they are scanned. Which gives something like
$planet's name$its gravity$$other planet's name$its gravity$$ etc etc
When i enter the orbit of "A 1 a" it works fine as it can find the full name. But if i enter "A 1" orbit and "A 1 a" was scanned before then the result is messed up.
Here is the code when the planet is scanned :
(the rounded variable allows to have a short but usable number whatever the gravity could be)
Set decimal [RoundedGravity] value to the value of [EDDI body scanned gravity] (round to 4 decimal places)
Set text [GravityList] to '{TXT:GravityList}${TXT:EDDI body scanned body name}${DEC:RoundedGravity}$' // "EDDI near surface bodyname" is a plugin variable indicating the name of the planet i am approaching
Here is the code when orbit enter:
Set text [BodyGravity] to '{TXT:GravityList}'
Set text [BodyGravity] to '{TXTPOS:EDDI near surface bodyname:GravityList:0}'
Set text [BodyGravity] to '{TXTSUBSTR:GravityList:{EXP:{TXT:BodyGravity} + {TXTLEN:EDDI near surface bodyname} + 1}:5}
Basically it searches for the name of the planet's orbit, find its beginning position, find its end position with the $ associated, keep only the following number from the end which is supposed to be its gravity.
Is there a way to tell the code that a "Body name" should end with a "$" else it's not the right thing to take ?