Thanks Doug - that solves the program completely and very quickly answered
too!  Apologies about the very messy code.

All the best
Joe

-----Original Message-----
From: Doug Cubin [mailto:[EMAIL PROTECTED] 
Sent: 12 August 2005 12:40
To: Joe Nunn
Subject: RE: MI-L Preventing creation of .tmp files in MapBasic

Hi Joe
Whenever I do any SELECTs, I tend to always use a table name rather than
having to keep track of queries- as you know these soon build up like theres
no tomorrow!

So where you do: Select * From Minor_rd   where Road_Name = street

I would identify a table:

Select * From Minor_rd  where Road_Name = street into mytmptable

Then use the table mytmptable for your functions.  Note that each call of
the Select statement with the INTO parameter, re-populates that table with
the currently selected objects.  Then you combine still works on the
currently selected objects - but not on them as "queryx".
I think that should reduce your temp files.

Hope that helps!

Doug

www.gis-solved.com


-----Original Message-----
From: Joe Nunn [mailto:[EMAIL PROTECTED]
Sent: 12 August 2005 12:01
To: [email protected]
Subject: MI-L Preventing creation of .tmp files in MapBasic


Dear All



I am just starting MapBasic and have written a program to combine streets
with the same name into a single object.  Here is the code:



global street as string, last_street as string

global last_osodr as string, info_osodr as string





fetch last From Minor_rd

last_osodr = Minor_rd.OSODR



print "last street equals"

print last_street





Set Table Minor_rd FastEdit On





Do



fetch first From Minor_rd

street = Minor_rd.Road_Name

print street



info_osodr = Minor_rd.OSODR

If info_osodr = "" then Exit Do

End If



Select * From Minor_rd

   where Road_Name = street



Objects Combine

   Data Feature_Code = Feature_Code, Road_Name = Road_Name, Route_Number =
Route_Number, Length_metres = sum(Length_metres)



Loop ''until info_osodr = last_osodr



Set Table Minor_rd FastEdit Off



It works on smaller files (10000 lines in the table)  but when I run it
creates many tmp files (eg ~MAP0634.tmp).  On a larger file it slows it
down, and eventually prevented me opening Mapinfo until I deleted these tmp
files.  Is there a way of preventing the production of these tmp files? Or
at least delate them as it goes along?



Best Regards



Joe Nunn



The XYZ Digital Map Company

Unit 9 Phase 2 Hardengreen Business Park

Dalhousie Road

Dalkeith, EH22 3NX

Scotland



Tel: +44 131 561 9645

Fax: +44 131 454 0443

E-mail: [EMAIL PROTECTED]



Web: www.xyzmaps.com





______________________________________________
This email has been scanned by Netintelligence
http://www.netintelligence.com/email

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.7/70 - Release Date: 11/08/2005

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.7/70 - Release Date: 11/08/2005





---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 17468

Reply via email to