Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Any better way around Duplicate Definition problems?
#15
(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.

Pete
So, break it down into chunks.

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'


Attached Files
.zip   SAMPLE.ZIP (Size: 652 bytes / Downloads: 84)
Reply


Messages In This Thread
RE: Any better way around Duplicate Definition problems? - by eoredson - 01-28-2025, 03:53 AM



Users browsing this thread: 1 Guest(s)