Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Perl as a test tool for Foxpro apps?

by planetscape (Chancellor)
on Aug 18, 2005 at 01:38 UTC ( #484654=note: print w/replies, xml ) Need Help??


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

Replies are listed 'Best First'.
Re^2: Perl as a test tool for Foxpro apps?
by talwyn (Monk) on Aug 18, 2005 at 12:32 UTC
    Thanks for the pointer! On the face of it this looks like it may be a viable approach! I'll keep ya posted. Thanks.

    talwyn

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://484654]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2020-12-02 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (25 votes). Check out past polls.

    Notices?