I clipped The following code from my startup routine (Hopefully I didn't miss anything important), but you should get the idea.
The end result is every "Client Environment Variable" will be assigned a BR Environment variable like CS_TEMP.
So CS_TEMP will point to the "REAL TEMP FOLDER" on the client computer.
I also substituted a few WSID or SESSION specific files to use Computername instead. We decided not to worry about WSID's any more except for creating temp files and such.
Here is the snippet:
Code: Select all
39000 DEF Fncs_Env
39010 DIM Tempenv$*2048, Addstr$*3, Leftstr$*2048, Rightstr$*2048, Tmp$*2048,Cs_Textfile$*256,Client_Drive_N_Path$*256,Server_Drive_N_Path$*256
39020 LET Gw_Strgchk$="="
39030 LET Cs_Textfile$="cs-"&Session$&".txt"
39040 EXECUTE "*sys -M set > "&Cs_Textfile$
39050 OPEN #1: "NAME="&Cs_Textfile$,DISPLAY,INPUT ERROR XIT_FNCS_ENV
39060 STARTLOOP: !
39070 LET Addstr$="CS_"
39080 DO
39090 LINPUT #1: Tempenv$ ERROR XIT_LOOP
39100 LET Gw_Wholeline=Len(Rtrm$(Tempenv$)) !:
LET Gw_Addlen=1 !:
LET Gw_Posfnwp=Pos(Uprc$(Tempenv$),"=")
39110 IF Gw_Posfnwp>0 THEN
39120 LET Gw_Equal =Pos(Tempenv$,'=')
39130 LET Gw_Nextequal =Pos(Tempenv$,'=',Gw_Posfnwp+Gw_Addlen)
39140 IF Gw_Equal > 0 THEN
39150 LET Leftstr$ = Addstr$&Tempenv$(1:Gw_Posfnwp-1)
39160 LET Rightstr$ = Tempenv$(Gw_Posfnwp+1:Gw_Wholeline)
39170 LET Setenv(Leftstr$,Rightstr$) ERROR 39180
39180 ! Should SETENV FAIL, Ignore it
39190 END IF
39200 END IF
39210 LOOP
39220 XIT_LOOP: ! End of Startloop
39230 CLOSE #1: ERROR 39240
39240 !
39260 XIT_FNCS_ENV: LET _Session_Len=Len(Session$) : LET Session_Id$=Session$(_Session_Len:_Session_Len) ! End of Function
39261 IF Trim$(Env$("CS_COMPUTERNAME"))<>"" THEN !:
EXECUTE "*CONFIG SUBSTITUTE N:CPRIN."&Wsid$&" N:PRN-"&Env$("CS_COMPUTERNAME")&".INT" ERROR 39262
39262 IF Trim$(Env$("CS_COMPUTERNAME"))<>"" THEN !:
EXECUTE "*CONFIG SUBSTITUTE FIN-"&Session$&".HTM FIN-"&Env$("CS_COMPUTERNAME")&"-"&Session_Id$&".HTM" ERROR 39263
39263 EXECUTE "*sys -M CD > "&Cs_Textfile$
39264 OPEN #1: "NAME="&Cs_Textfile$,DISPLAY,INPUT ERROR XIT_FNCS_OS_PATH
39265 LINPUT #1: Client_Os_Path$ ERROR XIT_FNCS_OS_PATH
39267 CLOSE #1: ERROR XIT_FNCS_OS_PATH
39268 IF Exists(Cs_Textfile$) THEN !:
EXECUTE "*Free "&Cs_Textfile$
39269 XIT_FNCS_OS_PATH: ! @
39299 FNEND