First pass conversion of NAV Patterns
This commit is contained in:
parent
1341938262
commit
6b32107a72
325 changed files with 11946 additions and 0 deletions
59
content/NAVPatterns/variable-capacity-mismatch/index.md
Normal file
59
content/NAVPatterns/variable-capacity-mismatch/index.md
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
+++
|
||||
title = "variable-capacity-mismatch.md"
|
||||
weight = 1410
|
||||
+++
|
||||
Do not assign a value to a variable whose capacity is smaller.
|
||||
|
||||
It will throw an error at runtime.
|
||||
|
||||
Bad code
|
||||
|
||||
FileName@1010 : Text\[250\];
|
||||
...
|
||||
UploadedFileName@1016 : Text\[1024\];
|
||||
...
|
||||
FileName := UploadedFileName;
|
||||
|
||||
Good code
|
||||
|
||||
FileName@1010 : Text\[1024\];
|
||||
...
|
||||
UploadedFileName@1016 : Text\[1024\];
|
||||
...
|
||||
FileName := UploadedFileName;
|
||||
|
||||
Bad code
|
||||
|
||||
FileName@1010 : Text\[250\];
|
||||
...
|
||||
UploadedFileName@1016 : Text\[1024\];
|
||||
...
|
||||
FileName := UploadedFileName;
|
||||
|
||||
Good code
|
||||
|
||||
FileName@1010 : Text\[250\];
|
||||
...
|
||||
UploadedFileName@1016 : Text\[1024\];
|
||||
...
|
||||
FileName := COPYSTR(UploadedFileName,1,250); // In case only the first 250 chars are needed. Similar for fields
|
||||
|
||||
Bad code
|
||||
|
||||
VAR
|
||||
ExceededNumberTxt@001 : 'ENU=Warning: Exceeded number of unsent documents/requests'
|
||||
Subject@1002 : Text\[50\];
|
||||
...
|
||||
BEGIN
|
||||
...
|
||||
Subject := ExceededNumberTxt;
|
||||
|
||||
Good code
|
||||
|
||||
VAR
|
||||
ExceededNumberTxt@001 : 'ENU=Warning: Exceeded number of unsent documents/requests'
|
||||
Subject@1002 : Text\[100\];
|
||||
...
|
||||
BEGIN
|
||||
...
|
||||
Subject := ExceededNumberTxt';
|
||||
Loading…
Add table
Add a link
Reference in a new issue