User-Defined Type as Optional Argument

  • Thread starter Thread starter Jack Leach
  • Start date Start date
J

Jack Leach

Hi, thanks in advance for any insight...

I have a UD Type that I want to pass as an optional argument to a function.

The Help file states that you can't do this (optional args are apparently
picky about certain datatypes).

My thought was to try to put this Type into a ParamArray, but I seem to be
having all sorts of problems doing this.

Is it possible to put a custom Type into an array? Is it possible to use a
ParamArray and pass no values to it (make it optional, so to speak).

My ultimate goal is to pass a Type that contains printing preferences to a
global function for initializing a report... I was planning on being able to
test IsMissing on the optional arg and leave the report printer at it's
default, but this doesn't seem to be possible...

Worst case, I can break down all of these printing parameters into seperate
variables rather than using a Type, but I'm rather curious about how these
Types and Arrays and ParamArrays can work together, if at all...

I would love to be able to optionally pass the Type, but if I have to I'll
break them down.

Any ideas?? Thanks!


--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
hi Jack,

Jack said:
Is it possible to put a custom Type into an array? Is it possible to use a
ParamArray and pass no values to it (make it optional, so to speak).
No, not really.
Worst case, I can break down all of these printing parameters into seperate
variables rather than using a Type, but I'm rather curious about how these
Types and Arrays and ParamArrays can work together, if at all...
Instead of using a type I would try using a class.


mfG
--> stefan <--
 
I suppose that would be the thing to do... hadn't even thought of that -
enough of trying to squeeze functionality out of things that aren't made for
it... time to bite the bullet and take the jump?

New territory here I come!!

Thanks for the direction

--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 
Back
Top