Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Boudewijn Lutgerink
  Where is Boudewijn Lutgerink?
 Hoonaardstraat, Driel
 Netherlands
 Boudewijn Lutgerink
 To: Boudewijn Lutgerink
  Where is Boudewijn Lutgerink?
 Hoonaardstraat, Driel
 Netherlands
 Boudewijn Lutgerink
 Tags
Subject: RE: What's the best way to Save-Set-Restore Setting sample code
Thread ID: 434 Message ID: 436 # Views: 2 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Wednesday, May 30, 2001 7:28:00 AM         
   


> > What's the best way to Save-Set-Restore Setting like Set Talk/ Set Exclusive/../../..
> >
> > John
>
> Using custom classes John,
>
> In the init:
> 1. save the settings.
> 2. Set the new settings.
>
> In the destroy:
> reset the old setting saved in the class.

John just called me for some sample code. here goes:
**************************************************
*-- Class: set_exact (c:\testdir\setreset.vcx)
*-- ParentClass: custom
*-- BaseClass: custom
*-- Time Stamp: 05/30/01 02:20:09 PM
*
DEFINE CLASS set_exact AS custom

coldsetting = ""
Name = "set_exact"

PROCEDURE Init
LParameter tcSetting
this.cOldSetting = set("EXACT")
set exact &tcSetting.
ENDPROC

PROCEDURE Destroy
LOCAL lcOldSetting
lcOldSetting = this.cOldSetting
set exact &lcOldSetting.
ENDPROC

ENDDEFINE
*
*-- EndDefine: set_exact
**************************************************

and here's the code for the commandwindow:

?set("EXACT") && Should be OFF
set classlib to setreset additive
oExact = createobject("set_exact","ON") && give the poor sod a life
?set("EXACT") && set exact is now ON
rele oExact && dump that poor sod
?set("EXACT") && Should be OFF again
rele classlib setreset


ENTIRE THREAD

What's the best way to Save-Set-Restore Setting like Set Talk/ Set Exclusive/../../.. Posted by John Zylstra @ 5/30/2001 6:43:07 AM
RE: What's the best way to Save-Set-Restore Setting like Set Talk/ Set Exclusive/../../.. Posted by Boudewijn Lutgerink @ 5/30/2001 7:03:40 AM
RE: What's the best way to Save-Set-Restore Setting sample code Posted by Boudewijn Lutgerink @ 5/30/2001 7:28:00 AM
RE: What's the best way to Save-Set-Restore Setting sample code Posted by Eric den Doop @ 5/30/2001 7:46:52 AM