15

A procedure may have parameter by reference.

In C/SIDE a text-parameter would inherit the length-property from the caller.


Example:

1 Declaring global var myGlobalText[33]

2 Declaring “myProcedure(VAR prmTextVariable[10])” (or whatever length, is any)

3 Calling myProcedure(myGlobalText)


In C/SIDE prmTextVariable would hold a maxlength at 33 bytes.


In AL it holds maxlength at 10 bytes (or whatever declared; if undeclared, then max is 250).


The C/SIDE-way is definitely preferable.

Reason is that in some cases a a variable should not exceed a specific lenght in e.g. various reportings.

And using a procedure for a (repeating) task like this is absolutely the right path to go.

But in AL it is useless.

Category: Development
STATUS DETAILS
Needs Votes
Ideas Administrator

Thank you for this suggestion! Currently this is not on our roadmap. We are tracking this idea and if it gathers more votes and comments we will consider it in the future. Best regards, Business Central Team