'S_SETENV   - sets environment & variables

external   $drive $a_drive

public   setenv()             '  sets/resets SmartWare II environment
public   clearenv()           ' clears environment set by setenv()

public   cpath dpath ipath lpath upath rpath spath tpath uname uconn userv
public   fgs bgs fge bge fgp bgp fgi bgi fgd bgd sch scw scc scr psa dsa
public   currview currlib pmscn pmexe pmsel pmlast ptstr ptval shopmask rbd
public   reqnmask city userid shoplist nr5 nr6 nr8 apath rollmask workers
public   jobnr phone vatrate #margin_A #margin_B #margin_C #margin_D fdp bbd
public   resref ucount pipath prpath sipath adpath dly_pstgpath reqnpath statemntpath
public   zippath

'core
'**** ARRAY DECLARATIONS ************************************************
'library
public   ulist[1,5] ptary[1]
'        ulist[] will be redimensioned as needed
'        ulist[1,1]      'user list "myname" column
'        ulist[1,2]      'user list "connection number"
'        ulist[1,3]      'user list "user name"
'        ulist[1,4]      'user list "send message" column
'        ulist[1,5]      'user list "message received" column

'        ptary[]         'public environment array for miscellaneous use
'core
'2**** CODE **************************************************************


function setenv()
lpath      = "C:\srvrprog\lib\"          'function library path
cpath      = "C:\srvrprog\"              'executable code path
' message "change ROLLMASK & spath in SETENV"
' message "drive"&str($drive)
dly_pstgpath= $drive|":\reports\dly_pstg\"     'stores DLY_PSTG reports
adpath     = $drive|"\indices\aged_drs\"      'confirmation lists sent to shops
sipath     = $drive|"\indices\supp_inv\"      'index path for price lists
prpath     = $drive|"\indices\supprnge\"      'index path for price lists
reqnpath   = $drive|"\indices\job_reqs\"      'index path for O/S purch's
pipath     = $drive|"\indices\os_purch\"      'index path for O/S purch's
ipath      = $drive|"\indices\"               'index path
rpath      = $drive|"\indices\reqn_idx\"      'index path for REQUSN's
spath      = $drive|"\indices\stk_idx\"       'index path for stock carpets
dpath      = $drive|"\data\"                  'data path
apath      = $drive|"\data\"                  'data path
zippath    = $a_drive|":\archive\"             'archive data path
' message "zippath is"&str(zippath)
' message "dpath is:"&str(dpath)
upath      = path(defpath)|""            'user home directory
tpath      = path(defpath)|""            'temp path
uname      = NULL                        'user name
uconn      = 0                           'network user connection #
userv      = NULL                        'network server name
ucount     = 0                           'number of network users
currview   = NULL                        'current active view
currlib    = NULL                        'function libraries currently loaded
fgs        = fgstandard                  'Smartware II
bgs        = bgstandard                  '    standard
fge        = fgerror                    '         screen
bge        = bgerror                    '              color
fgp        = fgpleasing                 '                   assignments
bgp        = bgpleasing                 '
fgi        = fginvpleasing              '
bgi        = bginvpleasing              '
fgd        = fgediting                  '
bgd        = bgediting                  '
fdp	   = 7
bbd        = 1
rbd	   = 4
sch        = scrheight                  'used by screen display functions
scw        = scrwidth                   'used by screen display functions
scr        = int(sch/2)                 'center row
scc        = int(scw/2)                 'center column
psa        = NULL                       'prior screen area (under last msg box)
dsa        = NULL                       'display screen area (actual msg box)
pmscn      = NULL                       'popmenu pulldown screen area
pmexe      = NULL                       'popmenu pm_menu.psl execute call
pmsel      = NULL                       'popmenu pm_menu.psl select item
pmlast     = 1                          'internal pm_menu() option pointer
ptstr      = NULL                       'general Pop-Tools string return var
ptval      = BLANK                      'general Pop-Tools value return var
redimension  ulist[1,5]
redimension  ptary[1]
lock both public
lock module public[]
shopmask   = "[CcSsWwFfPpTtXx]U*5#"
shoplist   = "CSWFP"
reqnmask   = "[CcSsWwFfPpTtXx]U{#####}\-*2#"
city       = "*20{[A-Za-z\ ]U}"
rollmask   = "*2#XU\/*2#"
nr5 = "*5{[1234567890.]}"
nr6 = "*6{[1234567890.]}"
nr8 = "*8{[1234567890.]}"
workers = "Jim Mick David˙G John"	' spaces within names MUST be Alt-255
phone = "###-###-####"
resref = "[CcSsWwFfPpTtXx]U\R{####}"
vatrate = 17.5
#margin_A = 0.25
#margin_B = 0.3
#margin_C = 0.4
#margin_D = 0.5
end function ' setenv()

function clearenv()
unlock module public
clear public
unlock module public[]
clear public[]
end function ' clearenv()

