Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Passing a variable number of parameters to a function
Fri, Dec 4 2009 8:57 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

I just cocked up in my typing and typed

RCF(IFNULL(M._MktDesc,IFNULL(SC._Description,SG._Description,SC._Description),M._MktDesc),O._Description+', '),

rather than

RCF(IFNULL(M._MktDesc,IFNULL(SC._Description,SG._Description,SC._Description),M._MktDesc),O._description,', ')

note the + between the last two parameters rather than a comma. RCF (which is an SQL function) then treated the final parameter as NULL and it struck me that if I don't intend any of the parameters passed to be NULL then this could be a way of having a function with a variable number of parameters. Just stop when you hit the first NULL.

Is this safe or more along the lines of "what an interesting suggestion now go and play with the nice land mines"?

Roy Lambert

Sun, Dec 6 2009 7:06 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< Is this safe or more along the lines of "what an interesting suggestion
now go and play with the nice land mines"? >>

Actually, it's a bug.  However, I'm considering keeping it in place because
it is a nice way of doing variable parameters.  I'll let you know by the
next build what the decision will be.

--
Tim Young
Elevate Software
www.elevatesoft.com
Image