Hi Chiel,

I found that the best way to do this was to insert a counter and then close
and reopen the tables at a regular interval.

You may also notice that the time to do the calculation increases as the
program progresses.  If you use the above approach this doesn't happen.

To do this I include somelike the following:

        dim i as integer
        set table mytab fastedit on undo off
        for i = 1 to tableinfo(mytab,tab_info_nrows)
                fetch rec i from mytab
                        <<do my calcs here>>
                        <<do my calcs here etc>>
                        <<do my calcs here etc>>
                if i mod 1000 = 0 then          'set this to an appropriate
value usually based on trial and error but 2% is a good start
                        commit table mytable
                        <<commit myothertables if necessary>>
                        close mytable
                        <<close myothertables if necessary>>
                        open <pathtomytable>+mytable
                        <<open myothertables if necessary>>
                        set table mytable fastedit on undo off
                        <<set myothertables mytable fastedit on undo off if
necessary>>
                end if
        next


Hope this helps.


Cheers

Martin

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



-----Original Message-----
From: Markus Lindner [mailto:[EMAIL PROTECTED]]
Sent: Friday, 20 April 2001 18:44
To: Chiel Roovers; [EMAIL PROTECTED]
Subject: Re: MI-L Memory collapse running MapBasic program


Chiel,

i ran into the same problem, and the only way
was to split up the Program running the first 500000 rows,
then restart mapinfo, running the next rows...


Seems to be a memory hole there in mapinfo,

Regards,

Markus


----- Original Message -----
From: Chiel Roovers <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 18, 2001 4:43 PM
Subject: MI-L Memory collapse running MapBasic program


> Hello,
>
> While running a self-made MapBasic program which, in a for..next loop,
> calculates AreaOverlaps of numbers of regions, my PC crashes not having
> completed the task completely. Is there a way of telling MI to "clean-up"
> the registered memory during my calculation loops?
>
> Regards,
>
> Chiel Roovers,
>
> Netherlands
>
>
>
> ~~~~~~~~~~~~ List Sponsor ~~~~~~~~~~~~
> Digital GEO data for 125 countries
> LAND INFO International produces digital geographic data for over 125
> countries.   DEMs, satellite imagery, topo maps, vector map layers,
> flood maps, and more.   Visit http://www.landinfo.com/indexdm1.htm and let
> our specialists find the right solution.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> _______________________________________________________________________
> 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.
>


~~~~~~~~~~~~ List Sponsor ~~~~~~~~~~~~
Digital GEO data for 125 countries
LAND INFO International produces digital geographic data for over 125
countries.   DEMs, satellite imagery, topo maps, vector map layers,
flood maps, and more.   Visit http://www.landinfo.com/indexdm1.htm and let
our specialists find the right solution.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

_______________________________________________________________________
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.



_______________________________________________________________________
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