Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Beforeopentables and returning .f.
Message
From
20/09/2004 17:38:41
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
20/09/2004 15:51:39
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00944089
Message ID:
00944283
Views:
14
>Perfect Cathy. Thanks! I had tried a form property but I didn't have the sequence correct to set it and check for it. Now it is working great. However, just curious, but is there a way to check for the existence of a table without knowing its actual filename? Sort of like when you reference the recordsource of a grid:
>
>IF USED(thisform.grdletter.recordsource)
>   SELECT (thisform.grdletter.recordsource)
>ELSE
>   WAIT WINDOW "Cannot select table." NOWAIT
>ENDIF
>
>
>I would like to be able to check for the existence of the table without knowing the actual filename referencing the cursor property in the dataenvironment or maybe step through all of the cursors in the dataenvironment and ensure they exist before instantiating the form.

The function select("youralias") will return zero if youralias is not used, so

select select("youralias")

is for me a way to get into that workarea when needed, specially if I want to open it and I'm not sure whether it's already open.

In your case, however, you are probably still in de.beforeopentables(), when the other objects may not be instantiated yet, and any parameters passed to the form won't be encountered until form.init()... Still, depending on what you want to do, there should be some way to do that, exactly along the lines of the code above.

Umm... "to check for existence of the table"... would file(defaultext(cFile, "dbf")) work? Assuming cFile contains the path to where you expect the file to be, or that the file is supposed to be along set("path"). You can just have a thisform.whatever instead of cFile.

back to same old

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

Click here to load this message in the networking platform