Hello Michael,

The reason for your error is that once your fetch has been done
(successfully or not) the code for your error handler is encountered and the
"resume next" is called without the context of an error. You need to
terminate your subroutine with an "exit sub" (or "exit function" if it's a
function) *before* the error handler so that this code is really only called
as the consequence of an error. Hope that solves the problem.

Regards,
Warren Vick
Europa Technologies Ltd.
http://www.europa-tech.com


-----Original Message-----
From: Medsker, Michael [mailto:[EMAIL PROTECTED] 
Sent: 29 January 2004 01:37
To: ' ([EMAIL PROTECTED])'
Subject: MI-L MapBasic OnError


Hoping someone can help me with a MapBasic question. I'm trying to use Fetch
to get Objects using Rec # from a table which contains deleted records.
Don't want to Pack first. I want to be able to note which row/record #s were
marked for deletion. Below is a test that I played with to see if I could
get MapBasic to print the rec number every time it hits a deleted record and
then print the total number of rows at the end. It doesn't work. The problem
seems to be that Resume try's to invoke every time the loop starts instead
of just when a deleted record is found. I get a "Found Resume while not
process an error, application halted" message. Note that I have moved the
error_dim_main: out of the loop but the Resume Next doesn't work after the
error, which is understandable because I jumped out of the loop.

Nrows_m is the row counter
Dim_line is the table


nrows_m = 0
Do While Not EOT(dim_line) 
nrows_m = nrows_m + 1 
OnError GoTO error_dim_main
Fetch Rec nrows_m From dim_line
error_dim_main: 
        Print nrows_m
        Resume Next
Loop 


Any suggestions would be appreciated.

Thanks
Mike

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




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

Reply via email to