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,
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.