Skip to content

Commit 73b2ed8

Browse files
committed
Update byref doc
1 parent 9d9124d commit 73b2ed8

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

docs/byref.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ and no access is specified, it's supposed to be `ByRef` (arrays cannot be passed
2626
ByRef allows us to pass arrays to [FUNCTION](function.md) or [SUB](sub.md):
2727

2828
```
29-
REM arrays passed to functions can be of *any dimensions*. Use LBOUND and UBOUND to detect dimensions!
29+
REM arrays passed to functions can be of *any dimensions*.
30+
REM Use LBOUND and UBOUND to detect dimensions!
31+
3032
FUNCTION maxValue(ByRef a() as Ubyte) As UByte
3133
DIM i as UInteger
3234
DIM result As UByte = 0
@@ -40,8 +42,8 @@ DIM myArray(4) As UByte = {4, 3, 1, 2, 5}
4042
PRINT "Max value is "; maxValue(myArray)
4143
```
4244

43-
In this example, is `ByRef` was omitted, it will be used by default, since the parameter was an array.
44-
Arrays cannot be passed [ByVAL](byval.md).
45+
When passing arrays like in this example, if `ByRef` can be omitted.
46+
Arrays parameters cannot be passed to a function using [ByVAL](byval.md).
4547

4648
`ByRef` is also useful to return values in the parameters. [RETURN](return.md) allows to return a single value
4749
from a [FUNCTION](function.md), but we can return several values by storing the result in those parameters.

0 commit comments

Comments
 (0)