project BLF > class Cacher > method SetCharacterValue

Description

Store a character value in the cache, based on the name that is passed as input parameter. The cached data can be session dependent based on the value of the input parameter ilSessionData.


Parameters


icNameinputcharacterThe name of the cached character type item for which the value needs to be stored in the cache.
icValueinputcharacterThe value of the cached character data item with the name specified in icDataItemName, that needs to get stored in the cache.
iiSessionIDinputintegerID of the session to which the data item belongs.
Zero when the data item to store is not session dependent.
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


BLF
method Session.SetCharacterValue
method Session.SetPublicData


program code (program1/cacher.p)

if iiSessionID = 0
or iiSessionID = viCachedSessionID
then do:
    find tCachedData where
         tCachedData.tcName = icName and
         tCachedData.tcDataType = "c"
         no-error.
    if not available tCachedData
    then do :
        create tCachedData.
        assign tCachedData.tcName = icName
               tCachedData.tcDataType = "c".
    end.
    assign tCachedData.tcCharValue   = icValue
           tCachedData.tlSessionData = (iiSessionID <> 0).
end.