in reply to Re^2: Win32::OLE::Variant Array
in thread Win32::OLE::Variant Array

your suggestion helped. It produced the following output:
C:\HFAccess\dev\bbAPIPerl>perl -w tstblpdataII.pl
Error: 0
$VAR1 = [
[
bless( do{\(my $o = 27163716)}, 'Win32::OLE::Variant' ), '#N/A Mth Lmt'
]
];
end
C:\HFAccess\dev\bbAPIPerl>
But I know in VB there would be a '#N/A Mth Lmt' for every day between "2007/07/01" and "2007/07/10". Any ideas.
thanks

kd

Replies are listed 'Best First'.
Re^4: Win32::OLE::Variant Array
by almut (Canon) on Aug 20, 2007 at 22:26 UTC

    Maybe it's not interpreting your date range correctly (so your start and end data effectively map to the same (invalid/default) day...). Have you tried specifying the date strings in a different format when initialising VT_DATE? The docs seem to suggest something like "July 1,2007" or "July 1 2007".  Other than that, I'm afraid I can't help...

        It looks like you are getting a 3-dimensional array, with the top level array being an arrayref (in Perl, all nested arrays must be arrayrefs anyway). Data::Dumper essentially prints out the data structure as Perl code which, when executed, would (re-)create the data structure being dumped (ok, manual object instantiation would typically be done in a more readable fashion, but you get the idea...).

        (BTW, the representation of the squared brackets of the innermost array has automagically been turned into a fake link, because you weren't using <code> tags... but anyway :)

        The two values of the innermost array are a Win32::OLE::Variant object, and a regular string. This means you can access/print the given data structure like this:

        # get the type of the variant, as a number/ID # (see the docs or Variant.pm for what they represent) print $v->[0][0][0]->Type(), "\n"; # the stringified value of the object, if scalar # (for lists, use ->Dim() and ->Get() ...) print $v->[0][0][0], "\n"; # the string '#N/A Mth Lmt' - nothing special here print $v->[0][0][1], "\n";

        In case you should ever be getting more than one pair of values, you'll of course want to use loops...  Good luck!