Hi Harald.

The problem with some of the VBA functions is that the first and last
parameter need to be set and the ones in the middle have no meaning and
cannot be present. This can only be achieved by using named parameters. The
GoTo method, as a function, in VBA would be ...

GoTo(wdGoToBookmark,,,"BookmarkName")

OLEView shows the GoTo method as ...

[id(0x000000ad), helpcontext(0x095e00ad)]
HRESULT _stdcall GoTo(
[in] VARIANT* What, 
[in, optional] VARIANT* Which, 
[in, optional] VARIANT* Count, 
[in, optional] VARIANT* Name, 
[out, retval, optional] Range** prop);


I only want to supply What and Name, Which and Count are not valid for
bookmarks. Is there a true NULL type I can send?

Richard.

P.S. Thanks for the OLEView pointer.

-----Original Message-----
From: Harald Radi [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 25, 2003 5:14 PM
To: 'Richard Quadling'; [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: PHP, Windows and COM.



hi richard,

currently there is no way of calling a function with named arguments. your
proposed array syntax wouldn't allow for passing arrays. on the other hand
variant arrays can only be indexed arrays and not hash arrays so i could
treat all string indices as named parameters. this would be a possibility
though i still find it very confusing. if anybody has a good suggestion that
is feasable on top of the engine (meaning without modifying the
scanner/parser) don't hesitate to post it to the list.

back to your actual problem:
you still can call all functions without naming parameters, though you have
to specify the full list of parameters up to at least the last optional
parameter that should not be set to its default value (uuh, does this make
sence ? actually its exactly the same as calling a php function with
optional parameters). you can look up the default values for optional
parameters in the components typelibrary which is browsable using the
oleview tool. 

i hope that helps.

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to