Merge pull request #89 from StefanMaron/main
Cosmetic changes to the readability pages
This commit is contained in:
commit
0652b72824
8 changed files with 35 additions and 34 deletions
|
|
@ -20,7 +20,7 @@ end;
|
|||
## Good code
|
||||
|
||||
```AL
|
||||
IF FindSet() then
|
||||
if FindSet() then
|
||||
repeat
|
||||
...
|
||||
until next() = 0;
|
||||
|
|
@ -29,7 +29,7 @@ IF FindSet() then
|
|||
## Bad code
|
||||
|
||||
```AL
|
||||
IF IsAssemblyOutputLine then begin
|
||||
if IsAssemblyOutputLine then begin
|
||||
TestField("Order Line No.", 0);
|
||||
end;
|
||||
```
|
||||
|
|
@ -37,7 +37,7 @@ end;
|
|||
## Good code
|
||||
|
||||
```AL
|
||||
IF IsAssemblyOutputLine then
|
||||
if IsAssemblyOutputLine then
|
||||
TestField("Order Line No.", 0);
|
||||
```
|
||||
|
||||
|
|
@ -45,8 +45,8 @@ IF IsAssemblyOutputLine then
|
|||
|
||||
```AL
|
||||
// Except for this case
|
||||
IF X then begin
|
||||
IF Y then
|
||||
if X then begin
|
||||
if Y then
|
||||
//DO SOMETHING;
|
||||
end else
|
||||
(not X)
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ The `end else` pair should always appear on the same line.
|
|||
...
|
||||
end
|
||||
else
|
||||
begin
|
||||
...
|
||||
end;
|
||||
```
|
||||
|
|
@ -27,7 +28,7 @@ The `end else` pair should always appear on the same line.
|
|||
if OppEntry.Find('-') then
|
||||
if SalesCycleStage.Find('-') then begin
|
||||
...
|
||||
end else
|
||||
end else begin
|
||||
...
|
||||
end;
|
||||
```
|
||||
|
|
|
|||
|
|
@ -11,13 +11,13 @@ When calling an object statically use the Object Name, not the Object Id.
|
|||
## Bad code
|
||||
|
||||
```al
|
||||
Page.RunModal(525,SalesShptLine)
|
||||
Page.RunModal(525, SalesShptLine);
|
||||
```
|
||||
|
||||
## Good code
|
||||
|
||||
```al
|
||||
Page.RunModal(Page::"Posted Sales Shipment Lines",SalesShptLine)
|
||||
Page.RunModal(Page::"Posted Sales Shipment Lines", SalesShptLine);
|
||||
```
|
||||
|
||||
## [Discussions](https://github.com/microsoft/alguidelines/discussions/categories/bc-best-practices?discussions_q=named+invocations+category%3A%22BC+Best+Practices%22)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ A line of code should not have more than one statement.
|
|||
## Bad code
|
||||
|
||||
```al
|
||||
if OppEntry.Find('-') then exit();
|
||||
if OppEntry.Find('-') then exit;
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ A line of code should not have more than one statement.
|
|||
|
||||
```al
|
||||
if OppEntry.Find('-') then
|
||||
exit();
|
||||
exit;
|
||||
```
|
||||
|
||||
## Bad code
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ weight = 1050
|
|||
## Bad code
|
||||
|
||||
```al
|
||||
if Atom = '\>' then HasLogicalOperator := TRUE else begin
|
||||
if Atom = '\>' then HasLogicalOperator := true else begin
|
||||
...
|
||||
end;
|
||||
```
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ weight = 1270
|
|||
```al
|
||||
procedure SomeProcedure()
|
||||
begin
|
||||
if IsAdjmtBinCodeChanged then
|
||||
if IsAdjmtBinCodeChanged() then
|
||||
Error(AdjmtBinCodeChangeNotAllowedErr, ...)
|
||||
else
|
||||
Error(BinCodeChangeNotAllowedErr, ...);
|
||||
|
|
@ -24,7 +24,7 @@ weight = 1270
|
|||
```al
|
||||
procedure SomeProcedure()
|
||||
begin
|
||||
if IsAdjmtBinCodeChanged then
|
||||
if IsAdjmtBinCodeChanged() then
|
||||
Error(AdjmtBinCodeChangeNotAllowedErr, ...)
|
||||
Error(BinCodeChangeNotAllowedErr, ...);
|
||||
end;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue