[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
VS_Edit()            Emulates the dBASE III+ "Edit" command

Description:

  VS_Edit() emulates the dBASE III+ "Edit" command by allowing the user
  to page back and forth through the database records and optionally
  edit them.

Syntax:     

  n_Key = VS_Edit( l_Index )

Pass:       

  l_Index is a logical expression that should contain .T. if
  database is indexed otherwise it should contain .F.

Return:     

  n_Key is a numeric value representing the INKEY() value of last
  key pressed by user.

Notes:      


Example:    

  TEXTSHELL()     && Display all the background stuff
  DO WHILE .T.
     DISPFLDS()   && Display fields for current record
     n_Value = VS_EDIT(.T.)
     DO CASE
        CASE n_Value = 13  && [Return]
           EDITPROG()      && Edit current record
        CASE n_Value = 22  && [Insert]
           ADD_PROG()      && Add a new record
        CASE n_Value = 27  && [Escape]
           EXIT
     ENDCASE
  ENDDO

Usage:      

  VS_EDIT() is very useful for working with "flat" databases in that
  VS_EDIT() controls all the moving around inside your database and will
  handle SEEKs based on a pressed key, etc.

  Valid keys from with VS_EDIT()
  ----------------------------
  [HOME]  - Move to first record
  [END]   - Move to last record
  [PGUP]  - Move to previous record
  [PGDN]  - Move to next record

  Any AlphaNumeric character invokes a SEEK to the first record
  beginning with the pressed key (provided the database has an open
  index and l_Index is .T.).

  Any other key causes VS_EDIT() to exit and return the INKEY() value of
  the pressed key to the calling program.

  It is your job as the programmer to LOOP to display the records.  i.e.
  VS_EDIT() will return a value of zero for the four keys listed above
  (HOME, END, PGUP, PGDN). If your calling program receives a value of
  zero from VS_EDIT() it should merely loop and display the current
  record.

See Also: VS_Pick()*
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson