'KEYS_UPD - rebuild all keys in standard views

external   dpath messbox() vloadif() vunloadif() progress() progtag() fgi bgi
external   sch scw

public     ptstr

global     x $module $files

MAIN
single-step off
file unload all
screen clear box 1 1 sch scw 0 0 no-border
repaint off
smartpeek $_modl $module
$files = GETFNAMES(dpath|"*.vws"|($module),0)
messbox(" You are about to rebuild ALL keys for data files on drive:"&upper(dpath)|" ",0,1,1)
messbox(" Confirm ALL files on ALL workstations have been unloaded - y/n ",1,0,1)
if ptstr == "n"
  exit main
end if
x = 1
progress(15,9," Rebuilding keys for data files ",1)
while GROUP($files,x)<>null
  vloadif(dpath|group($files,x)|".vws")
' message "$file is:"&str($files)
  progtag(fgi,bgi,dpath|group($files,x))
  order key rebuild
  if cerror
    message GROUP($files,x)|".vws - keys not rebuilt"
  end if
  vunloadif(group($files,x)|".vws")
  x = x + 1
end while

END MAIN

