BusinessCentral.LinterCop
BusinessCentral.LinterCop copied to clipboard
LC0051: Raise diagnostic on exit() Method
It's a fictional example based on one of today's code review.
internal procedure GetFireTruck(): Text[10]
var
FireTruckLbl: Label 'FireTruck';
begin
exit(FireTruckLbl);
end;
When translation, for example to Dutch "Brandweerwagen", it becomes a length of 14 characters which will result in an runtime error.
In this example the label should have a MaxLength
or Locked
property set.
FireTruckLbl: Label 'FireTruck', MaxLength = 20;
FireTruckLbl: Label 'FireTruck', Locked = true;