When completing a certain method that calculates a value, and sets a TText.text to that value, I get the following error thrown:
'String index out of range. (-1) Must be >=0 and <=0'
I made sure my calculation was safe and handled possible exceptions before and after they may occur. It is really just a simple addition calculation....
A quick google search led me to: Firemonkey: Setting TLabel Text causes String Index out of Range Exception
1) I am not using carriage returns though, nor any line breaks. This is my code for setting the ttext value -
TotalCost.text:='$'+FormatFloat('0.00',total);
2) It is not a TLabel, but a TText component.
3) This does not throw any errors on any Android Device, the simulator or my 4th gen iPad running iOS 9.0.2, but DOES throw errors on the newer iPhones also running iOS 9.
Any ideas on a workaround or bug fix? Hard to debug which line exactly throws the error since I do not have direct access to a newer iPhone nor does the devices I have or simulator throw an exception when debugging.
Thanks
System.Character
class when passed string indexes as parameters. Up to, and including, XE8, those functions expect 1-based indexes on all platforms. But the error message says the index must be>=0
(it says>=1
in XE8), so EMB must have updated the functions in Seattle to account for 0-based strings on mobile platforms, and that change is apparently broken in some cases. I don't have Seattle installed to verify this, though. – Remy Lebeau