Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Works in Development, will it work in distributed app?
Message
 
 
To
31/01/2003 12:49:50
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00747730
Message ID:
00747754
Views:
17
I would make a couple of changes:

>The below works in development mode, but will it work in distributed apps? If it will work, is there any reason why NOT to capture the current data environment using this method and restoring it thus?
>
>*Capture Current Environment settings
>PRIVATE msafety
>msafety=SET('safety')
>SET SAFETY OFF
>PRIVATE lnSelect  && myalias
>lnSelect = SELECT()   && myalias=ALIAS()
>PRIVATE mrecno
>mrecno=0
>IF !EMPTY(ALIAS()) and NOT EOF()
>	store RECNO() TO mrecno
>ENDIF
>PRIVATE mviewfile
>mviewfile=hdir+sys(3)
>CREATE VIEW &mviewfile
>
>*HERE I close tables, open new tables, set relationships, etc for temporary
>*stuff will need to get back to original environment
>
>*Restore original environment settings
>SET VIEW TO &mviewfile
>IF FILE(mviewfile+'.vue')
>	DELETE FILE (hdir+mviewfile+'.vue')
>ENDIF
SELECT (lnSelect)
*IF !EMPTY(myalias)
*	SELECT(myalias)
*ENDIF
>IF mrecno>0
>	GOTO mrecno
>ENDIF
>SET SAFETY &msafety
>
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform