--- In [email protected], "Sheri" <sheri...@...> wrote:
> > That's easy, I can add a k for skip option
> > Of course you can only skip trailing args, so k would only be
> > valid at end of type spec.
 
> No, that's not what I meant. I was suggesting a spec for VT_EMPTY and one for 
> VT_NULL. Most of the items id'ed as VARIANT seem to be that way only because 
> they are optional. E.g., if you leave out the filetype string in 
> GetSaveAsFileName the method should default it to *.*. If omitting only from 
> the end, no need to specify. 

That's too tricky for this version, come back to me in some later version for 
that.

> Even without method_typed, 
> if we put "", maybe it should mean VT_EMPTY (if the typespec is a 
> "VARIANT").

In many cases, null string has a definite meaning.  In general case, I don't 
think there's any ANSI string value that couldn't, in some context, be a valid 
argument value (and therefore no possible string value that can always be 
safely assumed to be equivalent of "arg missing").


> > > Would like to come up with some procedure that would allow typing of 
> > > Variant arguments for use in normal method instead of method_typed.
> > 
> > That would be nice.
> > 
> > > How about:
> > > com.setargtypes="s s u s "
> > > ExcelApp.GetSaveAsFileName("TestVariants.xls", "Excel Files 
> > > (*.xls),*.xls", 1, "Hello")
> > > com.clearargtypes
> > 
> > Ugly but possible.  Just playing around with idea, how about
> > com.setargtypes only applies to next call to a method/get/put, then 
> > autmatically clears.  
> > 
> > Oh, of course it would have to be com.setargtypes("s s u s ")
> > 
> > Couls also have
> > 
> > com.setargtypes("s s u s stick")
> 
> That looks odd.

Yup.
 
  com.setargtypes("s s u s !") ??
  com.setargtypes("s s u s +") ??

> > if you wanted it to not auto-reset.
> 
> The autoreset idea sounds good. If not much overhead, can just keep calling 
> it, if method is being used in a loop.
 
Not much overhead.

> > > Would also want com.getargtypes
> > 
> > Sigh.
> 
> If always auto-reset, wouldn't need a a getter.

Oh goodie.
 
> >  
> > > (but still need a way to spec optional argument to be skipped, e.g., how 
> > > to skip the two arguments before "Hello"?)
> > 
> > You can never skip anything but trailing args.
> > 
> > Unless you use named, instead of positional arguments
> > (extensively used and documated in VBA).
> 
> In VB you just include the comma where an empty argument belongs.

But no such possibility in PowerPro.  I think Bruce's parser gets annoyed.
 



Reply via email to