'$B - test

external  dpath vloadif()
public    ptval jobnr
global    x navrecs()


MAIN
repaint on
repaint
single-step on
  vloadif(dpath|"despat_3.vw")
'   order change index "2invoice.idx"
  repaint on
  repaint
  ptval=0
  ptval = navrecs()
  if ptval = {p} or ptval = {P}
    jobnr = [Job_Nr]
message jobnr
'     continue while
  end if
END MAIN

function navrecs()
'1.5 02/26/91 MS / changed to take advantage of hiding the "Project Suspended"
'                  message during the {Home} and {End} movements
local x bot psmode
screen save scrheight 1 scrheight scrwidth bot
smartpeek $_spndmes psmode
if psmode = 1
     smartpoke $_spndmes 0
end if
while TRUE
     x = inchar
     if x = {Down}
          data goto record next
     elseif x = {Up}
          data goto record previous
     elseif x = {PgDn}
          data goto page next
     elseif x = {PgUp}
          data goto page previous
     elseif x = {^End}
          data goto record last
     elseif x = {^Home}
          data goto record first
     elseif x = {Home}
          suspendone
          keys Home,F8
          screen shortrestore bot
     elseif x = {End}
          suspendone
          keys End,F8
          screen shortrestore bot
     else
          exit while
     end if
end while
if psmode = 1
     smartpoke $_spndmes 1
end if
return (x)
end function   'navrecs()

