'**** HEADER ************************************************************
'setenv()
'Copyright (c) 1990-1991 Applied Resource Technologies, Inc.
'2305 Cedar Springs Road, Suite 150, Dallas, Texas 75201 U.S.A. 
'(214) 855-0449
'Description: sets up the required public variable environment
'**** FUNCTION DECLARATIONS *********************************************
'core
public   setenv()             '  sets/resets SmartWare II environment
'                                  including below listed publics
public   clearenv()           ' clears environment set by setenv()
'**** VARIABLE DECLARATIONS *********************************************
'library
public   lpath cpath dpath upath tpath uname uconn userv ucount
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
'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
'**** CODE **************************************************************


function setenv()
lpath      = path(syspath)|"poptools\lib\"      'function library path
cpath      = path(syspath)|"poptools\examples\" 'executable code path
dpath      = path(syspath)|"poptools\data\"     'data path
upath      = path(syspath)|"poptools\"          'user home directory
tpath      = path(syspath)|"poptools\"          '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                  '
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 module public
lock module public[]
end function ' setenv()

function clearenv()
unlock module public
clear public
unlock module public[]
clear public[]
end function ' clearenv()
