Condividi tramite


RequestData Method

Creates an array containing data from a table open in an instance of Visual FoxPro.

ApplicationObject.RequestData([nWorkArea | cTableAlias] [, nRecords])

Return Values

Array

Property Values

  • nWorkArea
    Specifies the work area number of the table from which data is stored in the array. If you omit cTableAlias and nWorkArea, data from the table open in the current work area is stored in the array.
  • cTableAlias
    Specifies the alias of the table from which data is stored in the array.
  • nRecords
    Specifies the number of records stored in the array, starting from the current record. If nRecords is omitted and sufficient memory is available, all records, starting from the current record, are stored in the array.

Remarks

Use the RequestData method to retrieve data from an instance of Visual FoxPro.

Example

The following example, run from within Visual FoxPro, creates a second instance of Visual FoxPro. The Customer table is opened in the second instance of Visual FoxPro.

An array containing data from the Customer table is created in the first instance of Visual FoxPro, and the contents of the array are displayed. The array contains data from the first 5 records in the Customer table. The second instance of Visual FoxPro is then closed.

oNewInstance = CREATEOBJECT('VisualFoxPro.Application')
oNewInstance.DoCmd "USE (HOME(2) + 'Data\Customer')"
aCustomerArray = oNewInstance.RequestData('Customer',5)
DISPLAY MEMORY LIKE aCustomerArray 
oNewInstance.DoCmd('QUIT')

See Also

DataToClip Method

Applies To: Application Object | _VFP System Variable