'STARTSVR - checks passwords, initiates all libraries etc. - for SERVER

'121200A JUL - v1.2

external   setenv() vloadif() vunloadif() messbox() chkfname()
external   navrecs() wraptext() arytostr() strcount() posnpopup() remove()

public     entry userid getrec menuchoice getday getftr greeting areas
public     fgp bgp scw sch psa cpath lpath fgi bgi $menu $title ptstr dpath
public     ptval $findcat base ptary[1] dsa $drive $a_drive spath ipath rpath apath

global     loadlibs() setup() i scr x
global     tgt lmsg mbox r1 r2 c1 c2 c3 c4 $cat1 $cat2 $cat3 $cat4 $cat5
global     y1 y2 y3
'  S_poplist poplist[1] $str_list y4 $fullname


MAIN
local $name
single-step off
  file unload all
  $a_drive = "C"     ' O=Drive D on COCKTAIL
'   $drive = "C:\database\data"
  $drive = "C"
'  $a_drive = "H"     ' O=Drive D on COCKTAIL
'  $drive = "F"
'message "Check file loc'ns - F: DATA - H: ARCHIVE (and KEYS_UPD.PF3)"
  lock system $drive
  lock system $a_drive

  load "S_SETENV.rf3" in-memory
  setenv()
  unload "S_SETENV.rf3"
  setup()

  loadlibs()

  screen clear box 1 1 sch scw 0 0 no-border
  repaint off
' message "spath is:"&str(spath)
' message "ipath is:"&str(ipath)
' message "rpath is:"&str(rpath)
' message "apath is:"&str(apath)
  transfer "srvrprog.rf3" in-memory

END MAIN


FUNCTION loadlibs()
' load other libraries
  load lpath|"bpopdb.psl" in-memory
  load lpath|"bpoptabl.psl" in-memory
  screen clear box 1 1 sch scw 0 0 no-border
  load lpath|"datelib.rf3" in-memory
  load lpath|"indexlib.rf3" in-memory
  load lpath|"envlib.rf3" in-memory
  load lpath|"strlib.rf3" in-memory
  load lpath|"dfilelib.rf3" in-memory
  load lpath|"filelib.rf3" in-memory
  load lpath|"uintlib.rf3" in-memory
  load lpath|"doslib.rf3" in-memory
  load lpath|"wraptext.rf3" in-memory
  load lpath|"soundlib.rf3" in-memory
  load lpath|"proj_lib.rf3" in-memory
END FUNCTION


FUNCTION setup()
  screen clear box 1 1 sch scw 0 0 no-border
  load lpath|"displib.rf3"
  window border
  smartpoke $_ins 0                      ' switch off INSERT mode
END FUNCTION
