Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use opens a dialog box?
Message
From
18/10/1998 19:16:34
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
18/10/1998 11:11:02
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00147859
Message ID:
00147984
Views:
33
>>You can simply Copy the ON ERROR example on VFP help!
>>Then, add further control on Error number.
>>
>
>The trouble is, for SQL statements and REPLACE and DELETE (and I'm sure others), no error is generated, a dialog box is opened, demanding that the user find some file that the user has no idea about. What's more the open dialog doesn't even say what file it wants you to find! A very ungraceful way to handle an unexpected situation.

Well, it can't have any idea of which file to ask for - this happens when you're in a workarea where nothing is USEd, and you issue a record- or table-oriented command, it has no table to do it on, and can't have an idea where to guess from.

For a moment, I thought it would be nice if it could raise an error, but then what would you do in the error handler, after receiving a "no table in use in the selected area" error code? The same error could be returned from many different situations, so you'd be in the middle of a long choice of possible causes.

OTOH, having a possibility that a table/record oriented command executes with no table is something which should be thoroughly eradicated while testing. Imagine having something record-related command in some kind of a loop; how many times would an error handler be invoked? Or, worse, is there any way to get out of such a loop via error handler? It can set an error variable, which we can test for in the loop header? Why don't we test for having a table in a first place?

Whew, it took me too long to say "I like it as it is".

>The bad part is, if this ever happens in code running on a web server in response to a hit, this 'find' dialog is equivalent to a hang. THere's no way around it, no matter how good you error handler is.

No way around it, indeed, even if we could use an error handler. There's a way away from it, checking for alias() in time.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform