how do i call a function where it is declared in another bas file? For example i have 2 bas files.
Declare Function sum( As Integer, As Integer ) As Integer
Function sum( a As Integer, b As Integer ) As Integer
Return a + b
End Function
Dim a As Integer
a = sum(1, 2)
Print a
Sleep
I set main.bas as the main module but i cannot call sum function....
The solution is the Declare statement to be written in main.bas
sum.bas
Function sum( a As Integer, b As Integer ) As Integer
Return a + b
End Function
main.bas
Declare Function sum( As Integer, As Integer ) As Integer
Dim a As Integer
a = sum(1, 2)
Print a
Sleep