Hi Marty,

Try this instead:

'***********************************************************
Include "MAPBASIC.DEF"

Dim  Name, Name2, szTab as String

'**Makes the edit faster, but prevents the user from using the Revert
Table/Rollback Table
'**Make sure that the table hasn't unsaved edits, this will raise an error
Set Table SECTORBOUNDRIES FastEdit On Undo Off

Fetch Rec 472 From MI_ERLANGTABLE
'Fetch First From MI_ERLANGTABLE   'If you want to start with the first ???

Do Until EOT(MI_ERLANGTABLE)

     Name = MI_ERLANGTABLE.CLASS
     Name2     = mid$(Name,1,InStr(1,Name,"/")-1)
     szTab     = Name2 + "_" + Right$(Name, 1)

     Select * from ERLANGARRAY_PNET_BESTSRV_CONTO
          Where CLASS = Name
          into szTab NoSelect

     If TableInfo(szTab, TAB_INFO_NROWS) > 0 Then
          Create Object As Union
               From szTab
               Into Table SECTORBOUNDRIES
               Data CLASS = szTab
               Group by CLASS
     End If
     Close Table szTab

     Fetch Next From MI_ERLANGTABLE
Loop

Commit Table SECTORBOUNDRIES
'***********************************************************

I hop ethis mgiht help!

Peter
------------------------------------------------------------------------------------------------
Peter Horsb�ll M�ller, GIS-Developer
Kampsax A/S, GIS Software & Solutions, Rugaardsvej 55, DK-5000 Odense, Denmark
tlf: + 45 63 13 50 13, dir: + 45 63 13 50 08, fax: + 45 63 13 50 90
mail: [EMAIL PROTECTED], http://www.mapinfo.dk, http://www.kampsax.dk
------------------------------------------------------------------------------------------------
Marty wrote:
Hello Lister's,
I'm having a problem with a small .MB program.  In a nut shell the program
combines polygons.  There are about 700 combinations (iterations) to run.
After about the 400th, or so, iteration MI gets an application error and
shuts down.  This is why I put the commit line in; so I would not lose the
previous work.  The program is below.  Is there a better way to write this?
I wanted to put the variable into an array but to be honest I suck at
programming and I could not figure out how to do that in MB.  Any help
would
be greatly appreciated.

Thank you, Marty.

Include "MAPBASIC.DEF"
Dim Name,Name2 as String
Dim i as Integer
Fetch Rec 472 From MI_ErlangTable
Name = MI_ErlangTable.Class
Name2 = mid$(Name,1,InStr(1,Name,"/")-1)
i = 0
Do While i <= 700

           Select * from ErlangArray_pnet_bestsrv_conto where Class = Name
into Name2
+ "_" + Right$(Name, 1)
           Create Object As Union From Name2 + "_" + Right$(Name, 1) Into
Table
SectorBoundries Group by Class Data Class = Name2 + "_" + Right$(Name, 1)
           Close Table Name2 + "_" + Right$(Name, 1)
           Fetch Next From MI_ErlangTable
           Name = MI_ErlangTable.Class
           Name2 = mid$(Name,1,InStr(1,Name,"/")-1)
           i = i + 1
Commit Table SectorBoundries
Loop




_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.

Reply via email to