Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Beforeopentables and returning .f.
Message
De
21/09/2004 08:52:20
 
 
À
20/09/2004 17:38:41
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00944089
Message ID:
00944498
Vues:
9
It's not really necessary right now, because in this case I know the name of the file, however, I was thinking that some generic code would be better than specifying the actual filename. I have employed Cathy's solution and it works, but I have to specify the filename literally. I would prefer to do something like step through all of the cursors in the DE and check for their existence and if they do not exist then do exactly as I am now using Cathy's code. I wanted generic code where I wouldn't have to know specifically what tables are in the DE to run it...


>>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.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform