Thisform.NewObject( 'oStdEnv', 'StdEnv', 'StdCustom.vcx' )And here is the code fopr the class:
************************************************** *-- Class: stdenv *-- ParentClass: custom Define Class stdenv As cusbase csysformats = "" cansi = "" ccentury = "" cconfirm = "" cdeleted = "" cexact = "" cexclusive = "" nfdow = 0 cfullpath = "" nmemowidth = 0 cnotify = "" cnull = "" csafety = "" nreprocess = 0 cstatus = "" cstatusbar = "" nstrictdate = 0 ctalk = "" cescape = "" ctextmerge = "" ccpdialog = "" Name = "stdenv" *-- Sets up the form environment Procedure Set *** Set the environment *** If we running an executable, there is no need to save settings If Version( 2 ) # 0 Set Escape On Set Asserts On This.SaveSettings() Else Set Escape Off Set Asserts Off Set Status Bar Off Endif Set Sysformats Off Set Resource Off Set Decimals To 4 Set Century On ROLLOVER 60 Set Ansi Off Set Confirm On Set Deleted On Set Exact Off Set Exclusive Off Set Multilocks On *** Is the first day of the week Monday? For a business, I would think so. Set Fdow To 2 Set Fullpath On Set Memowidth To 50 Set Notify Off Set Null Off Set NullDisplay To ' ' Set Reprocess To 10 Seconds Set Safety Off Set Status Off Set StrictDate To 0 Set Textmerge On Set Cpdialog Off Endproc *-- Resets the environment the way it was Procedure Reset *** Restore the original environment *** Can't just use the vfp default settings because these are developers *** who may get upset if you change their customized settings Local lcSetting With This lcSetting = .ccentury Set Century &lcSetting lcSetting = .csysformats Set Sysformats &lcSetting lcSetting = .cansi Set Ansi &lcSetting lcSetting = .cconfirm Set Confirm &lcSetting lcSetting = .cdeleted Set Deleted &lcSetting lcSetting = .cexact Set Exact &lcSetting lcSetting = .cexclusive Set Exclusive &lcSetting Set Fdow To .nfdow lcSetting = .cfullpath Set Fullpath &lcSetting Set Memowidth To .nmemowidth lcSetting = .cnotify Set Notify &lcSetting lcSetting = .cnull Set Null &lcSetting Set NullDisplay To Set Reprocess To .nreprocess lcSetting = .csafety Set Safety &lcSetting lcSetting = .cstatus Set Status &lcSetting lcSetting = .cstatusbar Set Status Bar &lcSetting Set StrictDate To .nstrictdate lcSetting = .ctextmerge Set Textmerge &lcSetting lcSetting = .ctalk Set Talk &lcSetting lcSetting = .ccpdialog Set Talk &lcSetting Endwith Endproc Procedure SaveSettings With This .ccentury = Set( 'CENTURY' ) .csysformats = Set( 'SYSFORMATS' ) .cansi = Set( 'ANSI' ) .cconfirm = Set( 'CONFIRM' ) .cdeleted = Set( 'DELETED' ) .cexact = Set( 'EXACT' ) .cexclusive = Set( 'EXCLUSIVE' ) .nfdow = Set( 'FDOW' ) .cfullpath = Set( 'FULLPATH' ) .nmemowidth = Set( 'MEMOWIDTH' ) .cnotify = Set( 'NOTIFY' ) .cnull = Set( 'NULL' ) .nreprocess = Set( 'REPROCESS' ) .csafety = Set( 'SAFETY' ) .cstatus = Set( 'STATUS' ) .cstatusbar = Set( 'STATUS BAR' ) .nstrictdate = Set( 'STRICTDATE' ) .ctalk = Set ( 'TALK' ) .cescape = Set( 'ESCAPE' ) .ctextmerge = Set( 'TEXTMERGE' ) .ccpdialog = Set( "Cpdialog" ) Endwith Endproc Procedure Init This.Set() Endproc Procedure Destroy If Version( 2 ) # 0 This.Reset() Endif Endproc Enddefine