Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Escape from dataenvironment..
Message
From
08/03/2011 10:29:23
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Escape from dataenvironment..
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01502909
Message ID:
01502909
Views:
157
Hi All,

I have forms that run external from the main program. In the DE.Beforeopentables() of the form, I do a low level test using fopen() to check if all the files of the table are intact. Typically, if of the file is bad or missing (not uncommon), the table won't open and the form doesn't open. This is the way I do it, don't tell me to do it another way. Here's an example:

local lnhandle,lcfilename,i

for i=1 to 5

do case
case i=1
if used(this.cursor8.alias)
exit
endif
lcfilename=upper(gcdefault+"DATA\+this.cursor8.alias+".DBF")
case i=2
lcfilename=upper(gcdefault+"DATA\"+this.cursor8.alias+".FPT")
case i=3
lcfilename=upper(gcdefault+"DATA\"+this.cursor8.alias+".CDX")
case i=4
lcfilename=upper(gcdefault+"DATA\"+this.cursor9.alias+".DBF")
case i=5
lcfilename=upper(gcdefault+"DATA\"+this.cursor9.alias+".CDX")
endcase

lnhandle=fopen(lcfilename)

if lnhandle>0
fclose(lnhandle)
else
x3msgsvc("Unable to open document table",lcfilename)
?
endif

next i

My problem is I can't seem to back out of the DE. It ignores Return (plain, .f.,.t., to whatever...), Unload, Destroy blah blah blah...
It just continues into the Load event.
The only thing that works is Return To Master, but in that case, it Quits.
Any suggestions?

Luke
Next
Reply
Map
View

Click here to load this message in the networking platform