The $__SETUP Program
The $__SETUP program is called once when SM32 first comes up. If you have things of a global nature this is the place to add it. (It would be best to add a CALL "MYSETUP" to $__SETUP.) $__SETUP is designed (as all the utilities are) to run under Windows and LInux, so you will she branches based on SSN. What follows is a discription of $__SETUP.

    0010 REM "$__SETUP"
    0100 REM 100,5

Console View Keyboard:
Since you are using WEB View for your application these settings are probably fine. (also see Console Mode - Keyboard)

    0105 REM set 9C->9F to ctl 1->4
    0110 LET A$=$00000A000D009C019D029E039F04$
    0115 LET A$=STBL("!TERMS",A$)
    0120 LET A$=STBL("!EDIT")
    0125 LET A$=A$+$9C419D409E429F43$
    0130 LET A$=STBL("!EDIT",A$)

Console View color to Black on White:

    0135 PRINT 'backgr','white','black','default','cs',

Set Document Done Mode:
This is require by the SMDE. (see SMDE Dependencies)

    0140 IF POS("LINUX"=SSN)=1 THEN LET A=RPM(0,IND=1);GOTO 0170 ELSE LET A=RPM(0,IND=2)
    0145 DIM K![32,256]
    0150 LET K!["type"]="SendDocumentDone"
    0155 LET K!["State"]="On"
    0160 REM "Turn On Document Complete Mode"
    0165 WRITE GUI K![ALL]

Directories:
The SMDE requires temp directories (see SMDE Dependencies). If you do not have the "Root of Temporary Directory" set in your config you should add a line 169 something like:

        0169 SETCONFIG("system","tempdir","C:\MYTEMP")

    0170 LET A$=CONFIG("system","tempdir")
    0175 IF A$="" THEN ESCAPE
    0180 IF POS("LINUX"=SSN)=1 THEN GOTO 0200
    0185 CALL "$__SET_TEMP_PATH",A$+"\"
    0190 LET B$=ETBL("tdir",A$+"\")
    0195 GOTO 0215
    0200 CALL "$__SET_TEMP_PATH",A$+"/"
    0205 LET B$=ETBL("tdir",A$+"/")
    0210 RCALL "$__SET_TEMP_PATH","<0>"+A$+"/";REM "ASSUMES Route 0"

Set FID(0) Name:
The value returned by FID(0) can be set to any string up to 6 characters long. The distributed "$__GET_FID0_NAME" sets a 2 character name based on the "tempdir". Modify "$__GET_FID0_NAME" as you see fit. Other possibilities are:
1. Base fid(0) on the IP address - CONFIG("system","ip_0")
2. Use the NIC card mac address as a key to a direct file - CONFIG("system","mac_0")

    0215 CALL "$__GET_FID0_NAME",A$
    0220 CALL "$__SET_FID0_NAME",A$
    0225 RCALL "$__SET_FID0_NAME",A$

Create HTML directories:

    0230 MKDIR ETBL("tdir")+"HTML",ERR=.+1
    0235 MKDIR ETBL("tdir")+"HTML\IMAGES",ERR=.+1

Local Time Difference:
The times stored by the operating system are in Universal Time. The following code shows how to use ETBL("loctdiff").

        1000 FID (X)*,*,Q$
        1005 LET X$=DTO("19700101000000",DEC(SWAP(Q$(29,4)))+NUM(ETBL("loctdiff")))
        1010 LET C$=X$(1,4)+"-"+X$(5,2)+"-"+X$(7,2)+"  "+X$(9,2)+":"+X$(11,2)+":"+X$(13,2)
        1015 LET X$=DTO("19700101000000",DEC(SWAP(Q$(25,4)))+NUM(ETBL("loctdiff")))
        1020 LET M$=X$(1,4)+"-"+X$(5,2)+"-"+X$(7,2)+"  "+X$(9,2)+":"+X$(11,2)+":"+X$(13,2)
        1025 PRINT "Creatation Date:",C$
        1030 PRINT "Last Modified:",M$

    0240 PRECISION 6
    0245 LET F$=ETBL("tdir")+"TIMEX"
    0250 ERASE F$,ERR=.+1
    0255 INDEXED F$,100,100,-1
    0260 LET T=TIM*3600
    0265 LET U=UNT
    0270 OPEN (U)F$
    0275 FID (U)*,*,A$
    0280 CLOSE (U)
    0285 ERASE F$,ERR=.+1
    0290 LET X=DEC(SWAP(A$(25,4),$03$))
    0295 LET D$=DTO("19700101000000",X)
    0300 LET X=FDY(D$(1,8))*24*3600+2*FTD(D$(9))
    0305 LET T=T+FDY(GDY)*24*3600
    0310 LET D=T-X
    0315 LET D=INT(D/360)*360
    0320 PRECISION 2
    0325 LET A$=ETBL("loctdiff",STR(D))
    0330 SETCONFIG "system","loctdiff",STR(D)

    0335 IF CONFIG("system","release")="1" THEN EXIT

Load Utility Menu:

    0340 CALL "$__BEDITMENU",""
    0345 PRINT 'gwin'("statuson"),'status'("Ready"),
    0350 EXIT