MobiFlight is an open source project that allows you to create your own home cockpit for your favorite flight simulator in a flexible, affordable and extremely user-friendly way.
Describe the bug
New substring modifier returns incorrect number of characters
Steps To Reproduce
Steps to reproduce the behavior:
Set a string value 'ABCDEFGH' to an output config
Add Substring modifier and select from 0 to 5
Display value in 7 segment display
Note the string displayed has 5 characters, not 6
Expected behavior
The modifier default position says 0, so counting from 0 the modifier should return one more than the number of the end position.
Actual behavior
The modifier returns one less than the expected number of characters.
Details
MobiFlight Version: 10.0.2.2
FlightSim: irrelevant
AddOn: irrelevant
Additional context
Maybe the dialog should say starting position: 0 and "Number of character: 5"
Then the behavior would be consistent.
If I remember correctly, this is how the substring function was in the Fsuipc output config dialog.
Describe the bug New substring modifier returns incorrect number of characters
Steps To Reproduce Steps to reproduce the behavior:
Expected behavior The modifier default position says 0, so counting from 0 the modifier should return one more than the number of the end position.
Actual behavior The modifier returns one less than the expected number of characters.
Details
Additional context Maybe the dialog should say starting position: 0 and "Number of character: 5" Then the behavior would be consistent.
If I remember correctly, this is how the substring function was in the Fsuipc output config dialog.