In Sydney does string still zero based in mobile?

Viewed 107
2 Answers

"..so is the doc inaccurate ?"

Yes, the document you are reading is not updated with the latest information.

See Zero-based strings:

Compilers (desktop and mobile) have as predefined {$ZEROBASEDSTRINGS OFF} indicating the use 1-based string indexes.

Note: Previous to Delphi 10.4 the mobile compilers used by default 0-based indexing for strings.

You can still use zero-based strings by setting {$ZEROBASEDSTRINGS ON}

Also from docs:

In general terms, string indexing is now uniform across platforms and uses 1-based index model.

Notice however that:

  • Delphi string type helpers (TStringHelper) remain 0-based.
  • All Delphi global flat functions are 1-based.
Related