LC0085 - StefanMaron/BusinessCentral.LinterCop GitHub Wiki
Type Helper
codeunit.
Use the (CR)LFSeparator from the The rule will raise a diagnostic whenever a Char
or Text[1]
variable is assigned line-feed (10
) value directly, suggesting the use of the Type Helper
codeunit from the Base Application instead.
Avoid manually creating helper methods or directly assigning character values (e.g., Char := 10
or Text[1] := 10
) to define line-feed (LF) or carriage return (CR) separators. Instead, use the LFSeparator
and CRLFSeparator
constants provided by the Type Helper
codeunit.
Example
procedure MyProcedure()
var
myText: Text;
begin
myText[1] := 10; // Use the (CR)LFSeparator from the "Type Helper" codeunit from the Base Application to define a line feed (LF) or carriage return (CR) variable.
end;
procedure MyProcedure()
var
TypeHelper: Codeunit "Type Helper";
LineSeparator: Text;
begin
LineSeparator := TypeHelper.LFSeparator();
while MyCondition do
TextBuilder.Append(TypeHelper.ReadAsTextWithSeparator(InStream, LineSeparator));
end;