home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Spezial
/
SPEZIAL2_97.zip
/
SPEZIAL2_97.iso
/
ANWEND
/
ONLINE
/
SREFPRC1
/
WRTESTAT.SRF
< prev
Wrap
Text File
|
1996-11-20
|
1KB
|
47 lines
/* add a variable to the thread specific cache */
sref_write_state:
parse arg a_var,a_value,athread,usefile
usefile=strip(usefile)
athread=strip(athread)
a_var=strip(upper(strip(a_var)),'t',':')
if pos(' ',a_var)>0 | a_var="" then return 0
nonh="SEL REQUEST SOURCE THREAD DATE_TIME SERVER_NAME "
nonh=nonh||" CLIENT CLIENT_NAME CLIENT_PORT SERVER SERVER_PORT TRANSACTION !FUNGUS "
/* no writing of reserved words */
if wordpos(a_var,nonh)>0 then return 0
fooport=extract('serverport')
enmadd='SREF_'||fooport||'_'
ard=value(enmadd||'TEMPDATA_DIR',,'os2environment')
ard=strip(ard,'t','\')||'\'
if athread="" then
mytid=dostid()
else
mytid=athread
if usefile=' ' then
getfil=ard||'_T'||mytid||'.'||fooport
else
getfil=usefile
aa=stream(getfil,'c','query exists')
if aa="" then return 0
wow=cvread(getfil,dastuff)
if wow=0 then return 0
dastuff.a_var=a_value
wow=cvwrite(getfil,dastuff)
return wow /* 1=success, 0=failure */