WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

UDF - UDS Library
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Optional Parameters

 Keywords: Optional Varible Number Parameters UDF UDS User Defined Function Subroutine Global 

Question:

Is there a method of defining a UDF Function with a variable number of Parameters?

I have a LOG file routine which requires two Parameters (filename, Text) and I want to expand this to include an extra Flag Parameter for special cases but as this routine is used by hundreds of other source files I don't want to add this Parameter to all the existing code.

So I am after one Routine that Supports calls with Two or Three Parameters.

Is this possible?

Answer:

No, a WinBatch user defined function must have a dedicated number of parameters.

However here are a few work arounds:


Article ID:   W18335
Filename:   Optional Parameters.txt
File Created: 2012:06:27:07:52:32
Last Updated: 2012:06:27:07:52:32