>Hi,
> Becaz I USE the table in myclass, I don want the datasession used in form to be "interrupted".......
You can do this so it won't be. The object doesn't have a life outside of one method call, and all it seems to be doing is opening a file (in the same data session, without protecting the state of the tables in use) and set a logical, and then disappearing. You could accomplis much the same thing with a single method call in the form, something like:
* Your code:
mymethod
>
>DEFINE CLASS loSession AS SESSION
>PROCEDURE INIT
> IF .NOT. USED('User')
> USE User SHARED AGAIN
> CURSORSETPROP('Buffering', 5, 'User')
> ENDIF
>
> SELECT User
> IF SEEK(THIS.UserID, 'User', 'User_ID')
> IF Supervisor
> llPass = .T.
> ENDIF
> ENDIF
> USE
>
>ENDPROC
>ENDDEFINE
>
>loSession.DESTROY
>RETURN llPass
>
PROCEDURE GetUserIsSupervisor
LPARAMETER cUserID
LOCAL lResult, cInAlias
cInAlias = ALIAS()
SELECT 0
USE USER ALIAS (SYS(2015)) NOUPDATE AGAIN
LOCATE For cUser = User_ID
lResult = FOUND() AND Supervisor
USE
IF ! EMPTY(cInAlias)
SELECT (cInAlias)
ENDIF
RETURN lResult
ENDPROC