Bagikan melalui


APPEND Command

Adds one or more new records to the end of a table.

APPEND [BLANK] [IN nWorkArea | cTableAlias] [NOMENU]

Parameters

  • BLANK
    Adds one blank record to the end of the current table. Visual FoxPro does not open an editing window when you issue APPEND BLANK.

    You can edit the new record with BROWSE, CHANGE, or EDIT.

  • IN nWorkArea
    Specifies the work area of the table to which a new record is appended.

  • IN cTableAlias
    Specifies the alias of the table to which a new record is appended.

    If you omit nWorkArea and cTableAlias, a new record is appended to the table in the currently selected work area. If you issue APPEND, a blank record is added to the table you specify with nWorkArea or cTableAlias and the table is automatically selected. If you issue APPEND BLANK, a blank record is added to the table you specify with nWorkArea or cTableAlias and the table is not selected.

  • NOMENU
    Specifies that the Table menu title is removed from the system menu bar, preventing changes to the format of the editing window.

Remarks

When you issue APPEND or APPEND BLANK and a table isn't open in the currently selected work area, the Open dialog appears so that you can choose a table to which you can append records.

APPEND opens an editing window so you can enter data into one or more new records. When you add a new record, Visual FoxPro updates any indexes that are open.

Example

The following example uses APPEND BLANK to create a table with 10 records containing random values, then displays the maximum and minimum values in the table.

CLOSE DATABASES
CREATE TABLE Random (cValue N(3))
FOR nItem = 1 TO 10  && Append 10 records
   APPEND BLANK
   REPLACE cValue WITH 1 + 100 * RAND( )  && Insert random values
ENDFOR

CLEAR
LIST  && Display the values
gnMaximum = 1  && Initialize minimum value
gnMinimum = 100  && Initialize maximum value
SCAN 
   gnMinimum = MIN(gnMinimum, cValue)
   gnMaximum = MAX(gnMaximum, cValue)
ENDSCAN
? 'The minimum value is: ', gnMinimum  && Display minimum value
? 'The maximum value is: ', gnMaximum  && Display maximum value

See Also

APPEND FROM ARRAY | BROWSE | CHANGE | EDIT | INSERT - SQL | REPLACE