Hi Mike, I'll try to substitute your honey porter even though I might not taste that good ;-) Whenever you use the selection in your MapBasic application it is _converted_ from the selection into a QueryXXX. This is also the case when you use the "Select * From Selection..." What I do to avoid having all these Queries open afterwards is to read the "query nam" from the selection and then close it when I'm done with it, and I also use the NoSelect keyword when doing the Select: ******************************************* sub main dim o_section as object dim szSelName as string cls szSelName = SelectionInfo(SEL_INFO_SELNAME) select * from selection into zztable NoSelect Close Table szSelName o_section=zztable.obj
call findnodes(o_section,opps) print opps+" "'+o_section close table zztable end sub ******************************************* In this example you might even avoid doing the Select, and just read the obj from the query directly: ******************************************* sub main dim o_section as object dim szSelName as string dim aObj As Alias cls szSelName = SelectionInfo(SEL_INFO_SELNAME) aObj = szSelName & ".OBJ" o_section = aObj call findnodes(o_section,opps) print opps+" "'+o_section Close Table szSelName end sub ******************************************* HTH, Peter Horsb�ll M�ller GIS Developer Geographical Information & IT COWI A/S Odensevej 95 5260 Odense S. Denmark Tel + 45 6311 4900 Dir +45 6311 4908 Mob +45 5156 1045 Fax + 45 6311 4949 E-mail [EMAIL PROTECTED] http://www.cowi.dk <http://www.cowi.dk/> ________________________________ From: Cummings, Mike [mailto:[EMAIL PROTECTED] Sent: Mon 09-Aug-04 18:46 To: [EMAIL PROTECTED] Subject: MI-L Map basic call statement & selection queries I have written a sub that determines information about a region. In the process of testing the sub, I wrote a sub similar to what is below. I idea is that the user selects the region of interest and runs the sub. Well, it all worked, except when I went to close the table, I noticed that I had about 30 QueryXX tables open. Everything I tried to not create the query tables did work. I did determine that creation of the table is related to having an object in the calling sub. So, short of closing & re-opening the main table or combining the two sub, how do I stop the creation of the QueryXX tables? I thought using the select command & naming a table(see below) would work, but it doesn't. I have never quite understood why MI designed it so these tables are created and kept. This time, even the bottle of honey porter failed to give me some insight. '********************************************** include "mapbasic.def" include "menu.def" include "icons.def" declare sub main declare sub findnodes(byval areas as object, opps as string) sub main dim o_section as object cls select * from selection into zztable o_section=zztable.obj call findnodes(o_section,opps) print opps+" "'+o_section close table zztable end sub sub findnodes(byval areas as object, opps as string) opps="this is a test" end sub --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 12892
