Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>add_rec() add a new record locks.prg</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Add_rec()      Add a new record                        Locks.prg


Syntax:        Add_rec(<seconds>)

Argument:      <seconds> is the number of seconds to wait.  A value
               of zero means wait indefinitely.

Returns:       Add_rec() returns true (.T.) if the new record is
               successfully appended.  The new record then becomes
               current and is locked.  Otherwise, it returns false
               (.F.).

-------------------------------- Source Code -------------------------------

   FUNCTION Add_rec
   PARAMETERS wait
   PRIVATE forever

   APPEND BLANK
   IF .NOT. NETERR()
      RETURN (.T.)
   ENDIF

   forever = (wait = 0)
   DO WHILE (forever .OR. wait > 0)

      APPEND BLANK
      IF .NOT. NETERR()
         RETURN .T.
      ENDIF

      INKEY(.5)                 && wait 1/2 second
      wait = wait - .5

   ENDDO
   RETURN (.F.)                 && not locked


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson