http://qs1969.pair.com?node_id=484654


in reply to Perl as a test tool for Foxpro apps?

Hopefully this will be enough now to get you started:

Control of Visual FoxPro 8.0 from Other Applications

I've cobbled together a short example of how to get the proper object reference and do one simple method, because I am really not an expert in automating via Perl:

#!/usr/bin/perl use strict; use warnings; use Win32::OLE; use Data::Dumper; my $objVFP = Win32::OLE->new('VisualFoxPro.Application') or die "oops\ +n"; $objVFP->DoCmd('USE "C:\Program Files\Microsoft Visual FoxPro 7\Sample +s\Tastrade\Data\customer"'); my @arr = $objVFP->RequestData('Customer',5); print Dumper(\@arr);

The output from this snippet follows:

$VAR1 = [ [ [ 'ALFKI ', 'Alfreds Futterkiste ', 'Maria Anders ', 'Sales Representative ', 'Obere Str. 57 + ', 'Berlin ', ' ', '12209 ', 'Germany ', '030-0074321 ', '030-0076545 ', '6300', '2600', '2', ' ' ], [ 'ANATR ', 'Ana Trujillo Emparedados y helados ', 'Ana Trujillo ', 'Owner ', 'Avda. de la Constituci≤n 2222 + ', 'MΘxico D.F. ', ' ', '05021 ', 'Mexico ', '(5) 555-4729 ', '(5) 555-3745 ', '3500', '1900', '5', ' ' ], [ 'ANTON ', 'Antonio Moreno Taquerφa ', 'Antonio Moreno ', 'Owner ', 'Mataderos 2312 + ', 'MΘxico D.F. ', ' ', '05023 ', 'Mexico ', '(5) 555-3932 ', ' ', '8500', '1700', '6', ' ' ], [ 'AROUT ', 'Around the Horn ', 'Thomas Hardy ', 'Sales Representative ', '120 Hanover Sq. + ', 'London ', ' ', 'WA1 1DP ', 'UK ', '(71) 555-7788 ', '(71) 555-6750 ', '17100', '0', '1', ' ' ], [ 'BERGS ', 'Berglunds snabbk÷p ', 'Christina Berglund ', 'Order Administrator ', 'BerguvsvΣgen 8 + ', 'Luleσ ', ' ', 'S-958 22 ', 'Sweden ', '0921-12 34 65 ', '0921-12 34 67 ', '28600', '4900', '0', ' ' ] ] ];

HTH,

planetscape