Hi Tim

You need to change your sub statement to be exactly the same as the declare

eg
....
Declare Sub IsTableOpen(ByVal MyTable_str as string)
....

Sub IsTableOpen(ByVal MyTable_str as string)
        ....
        ....
        ....
        ....
end sub



Nice and simple really.  Your Sub statement can use a different variable
name if required
eg 
Sub IsTableOpen(ByVal SomeOtherName_str as string)  is also valid.

Cheers

Martin
==================================
Martin Roundill
GIS Manager
Waitakere City Council
Private Bag 93109
Henderson
Waitakere City
New Zealand


-----Original Message-----
From: Tim Warman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 7 March 2000 11:10
To: Mapinfo-L
Subject: MI sub does not match declare


Listers,

I keep getting the MB error "Sub procedure or Function IsTableOpen does not
match Declare", from the following bit of code kindly provided by Ahmet
Dabanli.

include "C:\Program Files\MapInfo\MapBasic\mapbasic.def"
Declare Sub WellsOpen
Declare Sub IsTableOpen(ByVal MyTable_str as string)
Declare Sub PlottingBit
Declare Sub OpenWells
Declare Sub OpenWater

'.....................................
'Define Variables.
'.....................................

Global H20Levels_str, Wells_str, FilePath_str, Aquifer_str As String
Global Year_int, Month_int as Integer
Global TableOpen_log as Logical

'.....................................
'Check to see if Wells and/or Water Levels are open.
'.....................................

Call IsTableOpen("Wells")
If TableOpen_log =0 Then Call OpenWells()
End If

Call IsTableOpen("Water_Levels")
If TableOpen_log =0 Then Call OpenWater()
End If

Sub IsTableOpen
dim k as integer
TableOpen_log = 0
For k =1 to NumTables()
        If TableInfo (k,1) = myTable_str Then TableOpen_log = 1
        End If
Next
End Sub

Am I missing something really obvious here?

TIA

_____________________________
Tim Warman
Geologist & GIS Specialist
Richard C. Slade & Associates
North Hollywood, CA
(818) 506-0418

----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to