(01-27-2025, 09:41 PM)Pete Wrote: Sure, but you had to Dim it in the calling procedure. So if the function were made into a library, that library would have to be accompanied by a bi file to include the Dim statement, either as SHARED, if it is not being passed, or without declaring as SHARED if, as in your example, it was being passed.So, break it down into chunks.
Pete
Code: (Select All)
Rem sample.bi header include file.
Dim Array(1 To 100) As Integer
Code: (Select All)
Rem sample.bm function include source.
Function DisplayArray (GetArray%())
For z = 1 To 100
Print GetArray%(z);
Next
DisplayArray = -1
End Function
Code: (Select All)
Rem $Include:'sample.bi'
Rem sample.bas Main source
For x = 1 To 100
Array%(x) = x
Next
z = DisplayArray(Array%())
If z Then Print "Correct."
End
Rem $Include:'sample.bm'