MobiFlight / MobiFlight-Connector

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.
https://mobiflight.com
MIT License
233 stars 104 forks source link

Substring modifier returns one less character #1558

Open JaimeLeon2 opened 10 months ago

JaimeLeon2 commented 10 months ago

Describe the bug New substring modifier returns incorrect number of characters

Steps To Reproduce Steps to reproduce the behavior:

  1. Set a string value 'ABCDEFGH' to an output config
  2. Add Substring modifier and select from 0 to 5
  3. Display value in 7 segment display
  4. Note the string displayed has 5 characters, not 6

image

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.

DocMoebiuz commented 9 months ago

This was the old FSUIPC style

image