I'm trying to write a handler to detect if a table needs packing - fetching row by row until the script encounters a deleted row...
it works, because when it hits a deleted row, it stops. but i'd hope it would follow my OnError label. any ideas why this is happening? (or rather, isn't happening?) cheers frank - - - declare sub packIfRequired(tableAlias as String) dim tableAlias as String include "mapbasic.def" tableAlias = "myTable" call packIfRequired(tableAlias) sub packIfRequired(tableAlias as String) Dim n, i as Integer n = TableInfo(tableAlias, TAB_INFO_NROWS) i = 1 Do While (i <= n) Print i OnError Goto NeedsPacking_error Fetch Rec i from tableAlias OnError Goto 0 i = i + 1 Loop Exit Sub NeedsPacking_error: Commit table tableAlias Print "packing" Pack Table tableAlias Graphic Data Exit Sub End Sub -- --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
