BusinessCentral.LinterCop
BusinessCentral.LinterCop copied to clipboard
LC0051: Raise diagnostic on Text.IncStr(Text) Method
Currently there's no diagnostic raised when using the Text.IncStr(Text) Method, where the outcome of the method could increase the length with one extra character.
codeunit 50100 MyCodeunit
{
procedure MyProcedure()
var
MyTable: Record MyTable;
SomeVariable: Code[20];
begin
MyTable.Validate(MyField, IncStr(SomeVariable)); // This could return a Text with a length of 21, causing an overflow
end;
}
table 50100 MyTable
{
fields
{
field(1; MyField; Code[20]) { }
}
}