AL icon indicating copy to clipboard operation
AL copied to clipboard

Text.Substring(1, x) unexpectedly works different from Copystr(Text, 1, x)

Open extensionsv2training opened this issue 7 years ago • 1 comments

Text t := 'string';

CopyStr(t, 1, 20), works as expected, and gives the full string.

t.Substring(1,20) crashes on on a runtime error "must refer to a location within the string".

Not consistent behavior, in my opinion.

extensionsv2training avatar Feb 17 '19 16:02 extensionsv2training

Hi @extensionsv2training,

It is because it didn't try to stay consistent with CopyStr but with how C# is working. Thanks for your feedback.

thpeder avatar Feb 18 '19 16:02 thpeder