Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Variable Not Found - Can't Debug
Message
From
02/03/2000 17:20:21
 
 
To
02/03/2000 15:47:19
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00340839
Message ID:
00340882
Views:
27
>SET WEIRD ON
>
>I have an error appearing - in development mode - without rhyme or reason and I can't trap it in the debugger other than to prove where its happening. The code snippet is simple enough:
>
>CASE ALIAS()='ORDHEADS'
>INDEX ON ACCREF TAG ACCREF [error occurs here - "Variable Date is not found']
>INDEX ON PADL(ORD_NUM,8,'0')+PADL(SUB_NUM,4,'0') TAG ORD_NUM ADDITIVE
>etc
>
>
>The error reported is 'Variable (whatever) not found'. (the first missing variable is 'date' - nothing to do with 'ORDHEADS' or ACCREF.)
>
>The ordinary dev-time error handler does not appear (with its 'Cancel Suspend etc' options); though it is 'available' for all other errors.
>(and even if I insert ON ERROR immediately before the offending line, the same messagebox comes up)
>
>I just get a box with 'Variable (whatever) not found' with only 'OK' and 'Help' options. (The sort of window we get running a compiled exe and your built in errorhandler fails to trap the error.)
>
>It then reports a series of variables not found with considerable repetition (the closest behaviour I can compare it too is the sort of thing we see if a form refresh isn't finding a bunch of variables. There is no 'refresh' code running in this case). I know exactly where these variables belong (in a completely different form and table)
>
>When its finished whining about a dozen times, it then carries on as though nothing has happened.
>
>All the while, neither the alias nor the form have changed and they are the correct ones. The variables being reported as not found aren't required at this point.
>
>So far I've tried various including:
>setting ON ERROR just before the DO CASE in case some alien errorhandler had been switched on somehow.
>I've switched the lines so that the second index is created first. Produces exactly the same error.
>setting a breakpoint on ERROR() to see if I can force it to stop at the error itself. No value appears in ERROR()
>
>Obviously I'm doing something silly elsewhere in my code, but with bizarre behaviour like this I can't figure out how to debug it. I can't expect anyone else to guess what the coding problem is, but can anyone give me a clue on how to begin to diagnose it!
>
>Thanks
>
>Harry

You don't happen to have any SET FILTER active for that table, do you? You might be using a FILTER with a variable that's not in scope.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform