>DEFINE CLASS PriceWS AS Custom OLEPUBLIC > isOpen= .F. > cDir= "" > oDS= .F. > > FUNCTION Init > LOCAL oINI AS IniAccess OF PriceWS, ; > cDir AS String > SET CLASSLIB TO PriceWS > SET DATE TO BRITISH > SET RESOURCE OFF > SET EXCLUSIVE OFF > SET CPDIALOG OFF > SET DELETED ON > SET EXACT OFF > SET SAFETY OFF > SET REPROCESS TO 2 SECONDS > this.oDS= CREATEOBJECT("Session") > SET DATASESSION TO this.oDS.DataSessionID > oINI= CREATEOBJECT("IniAccess") > oINI.getinientry(@cDir, "MySection", "Dir", "MyIni.ini") > m.cDir= ADDBS(m.cDir) > IF !EMPTY(m.cDir) > this.cDir = m.cDir > this.isOpen= .T. > USE (m.cDir + "MyTable.dbf") IN 0 SHARED ORDER MyOrder > ENDIF > ENDFUNC > > FUNCTION getString AS String > RETURN "String" > ENDFUNC > >ENDDEFINE >
Define class PriceWS as custom OlePublic isOpen= .F. cDir= "" oDS= .F. Procedure init Local oINI, cDir This.oDS=CreateObject('PrivateSess') Set DATASESSION TO this.oDS.DataSessionID * oINI= CREATEOBJECT("IniAccess") * oINI.getinientry(@cDir, "MySection", "Dir", "MyIni.ini") m.cDir = sys(5)+curdir() && Was on a dir where customer.dbf reside m.cDir= ADDBS(m.cDir) If !EMPTY(m.cDir) This.cDir = m.cDir This.isOpen= .T. Use (m.cDir + "customer.dbf") IN 0 SHARED ORDER tag cust_id Endif Endproc Procedure GetDataField Lparameters tcKey, tcField If seek(tcKey, 'customer','cust_id') Return eval('Customer.'+tcField) Else Return .null. Endif Endproc Procedure _getString Return "String" Endproc Enddefine Define class PrivateSess as Session DataSession=2 Procedure Init Set DATE TO BRITISH Set RESOURCE OFF Set EXCLUSIVE OFF Set CPDIALOG OFF Set DELETED ON Set EXACT OFF Set SAFETY OFF Set REPROCESS TO 2 SECONDS Endproc EnddefineCetin