Hi All,
Has anyone experienced problems passing Alias variables to functions?
When I do this it causes Mapinfo to crash every time. Strangely
subroutines work fine.
It seems the Alias variable gets corrupted somewhere in the function
call, and subsequent references to it cause MI to crash. I smell a bug
here...
The only way around it I can see is passing a string to the function
and recreating the alias variable there.
Here's the code:
'-----------------------------------------------------
Sub Main
Dim
sTAB, sCOL as string,
aCOL as alias,
lReturn as logical
sTAB = "MyTable"
sCOL = "MyColumn"
aCOL = sTAB + "." + sCOL
Fetch First from sTAB
Note "Main" + chr$(13) + "aCOL = " + aCOL
Call DoStuff_1(aCOL) 'Works fine.
lReturn = DoStuff_2(aCOL) 'Causes MI to crash in a heap!
End Sub
'-----------------------------------------------------
Sub DoStuff_1(aCOL as alias)
Note "DoStuff_1" + chr$(13) + "aCOL = " + aCOL
End Sub
'-----------------------------------------------------
Function DoStuff_2(aCOL as alias) as logical
Note "DoStuff_2" + chr$(13) + "aCOL = " + aCOL
DoStuff_2 = TRUE
End Function
'-----------------------------------------------------
Cheers,
Peter Zyczynski
Analyst Programmer
Insight GIS
Australia
Ph: (03) 6234-5833
Fax: (03) 6234-5899
[EMAIL PROTECTED]
www.insightgis.com.au
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 7114