SET REFRESH Command

Determines whether to and how frequently to update a browse window or memo editing window, or to refresh local memory buffers with changes from other users on the network.

SET REFRESH TO nSeconds1 [, nSeconds2]

Parameters

  • nSeconds1
    Specifies the number of seconds between updating the display for a browse window or memo editing window. nSeconds1 can be an integer value from 0 (default) to 3,600 seconds. Setting nSeconds1 to 0 does not update the records that you are viewing.

    Note

    Fractional values are truncated. If you specify a value other than 0 for nSeconds1 and omit nSeconds2, then nSeconds2 is set to the same value as nSeconds1. However, if you specify 0 seconds for nSeconds1 and omit nSeconds2, then nSeconds2 is set to 5 seconds.

  • [, nSeconds2]
    Specifies the number of seconds between refreshing the local memory buffers with current data from the network. The default value is 5 seconds. Setting nSeconds2 to 0 does not refresh the buffers.

    Tip

    You can improve performance by increasing the value of nSeconds2. You can also set this option in the Data tab of the Options dialog box.

    The following table describes values for nSeconds2.

    nSeconds2 Description

    -1

    Always read data from disk.

    0

    Always use data in memory buffer but do not refresh buffer.

    .001 to 3,600

    Refresh local memory buffers every number of seconds specified. Fractional values are accepted.

    Note

    For display purposes, Visual FoxPro rounds the value of nSeconds2 to the closest millisecond.

Remarks

Because tables can be opened for shared use on a network, it is possible that other users on the network are editing the records you are viewing in a browse window. By setting SET REFRESH, you can control the time interval between updates to the browse window. When you set the SET REFRESH command to a nonzero value and other users change records you are viewing, the records are updated when the refresh interval elapses.

SET REFRESH affects records displayed in a browse window opened with the BROWSE, CHANGE, or EDIT commands. Memo fields opened for editing in a browse window, for example, using the MODIFY MEMO command, are also updated. For more information, see BROWSE Command, CHANGE Command, EDIT Command, and MODIFY MEMO Command.

Visual FoxPro buffers portions of tables in memory on your workstation. SET REFRESH can specify how often data that is buffered locally on your workstation is refreshed.

See Also

Reference

SET Command Overview

Other Resources

Programming for Shared Access
Commands (Visual FoxPro)