in reply to OLE Visio syntax problem

This is essentially what you are trying to do:

use strict; use warnings; use 5.010; sub greet { say 'hello'; } greet() = 10;

Does that make any sense?

You probably need to do something like:

my $href = { visCharacterColor => 2, }; vsoChars->CharProps($href);

In perl, often times the getter and setter will be the same function--if the function has an argument, it will set the value; and if the function is called with no argument, then it will return the value. Check the docs to see what type the argument to CharProps() should be.

Replies are listed 'Best First'.
Re^2: OLE Visio syntax problem
by cr8josh (Sexton) on Jun 02, 2011 at 04:50 UTC

    Thanks for the feedback!

    In this case, I think my problem is that I'm using parentheses where I shouldn't. The "CharProps" is a 'property' in OLE, and that is usually accessed like so:

     $vsoChars->{Begin} = 2;

    For this property, though, there are different parts you can access, so there is an additional 'cell index' that needs to be passed in to access the correct property. 'visCharacterColor' is a constant, it's really just the number 1. I can't figure out how to get the cell index (1) passed so I can set what I want (the color) to 2 (red)...

    I've looked into the perl OLE documentation I could find and lots of web searching but no luck...so far...

    Thanks!