7.97.2 PERSIST Example

In this example, the user ID is persisted if the session successfully starts.  This will allow subsequent SRVROUTINES to have access to the user without having to create an addition FIELD_MAP.

Persist Fields(#gUserID)

* Signin routine. If the user id is valid, the session will be activated

Srvroutine Name(Signin)

Field_Map For(*Input) Field(#User)

Field_Map For(*Input) Field(#Password)

Field_Map For(*Output) Field(#io$sts) Parameter_Name(Status)

#User := #User.Uppercase

If (#Com_owner.VerifyUser( #User #Password ))

#Com_owner.StartSession

#io$sts := OK

#gUserID := #User

Else

#io$sts := ER

Endif

Endroutine