Skip to content
Home » basics


By Value, By Reference

This is about how function and subroutine parameters are passed in LotusScript, and how to use that intentionally in consideration of code maintainability and performance. For basic types There are two ways a caller can pass a parameter to a subroutine or function. A call “by value” gives the subroutine a copy of the value. A call “by reference” gives the subroutine access to the caller’s variable, so it can change the value of that variable. Here’s an example: Sub fie(a%, b%, ByVal c%) a = 11 b = 12 c = 13 End Sub Sub Initialize Dim x%, y%, z% x = 1 y = 2 z = 3 fie x, (y), z Print “x=” & x & “, y=” & y & “, z=” & z End Sub The output of this code… Read More »By Value, By Reference