You might also need to handle array constants:
abc,def,ghi(jkl(mno,{3,4,5;6,7,8},xyz)),pqr
and possibly multi-area ranges (I would probably ignore these since they
don't work properly as function parameters in most Excel versions).
Charles
___________________________________
The Excel Calculation Site
http://www.decisionmodels.com
"Jim Luedke" <(E-Mail Removed)> wrote in message
news:fd7168bb-ec3d-475a-98fc-(E-Mail Removed)...
> Rick, Charles:
>
> Thanks very much for reply.
>
> The more I think about it, the more I realize I prob. shouldn't have
> gotten involved in what values come alive at what time; and might
> instead have titled this thread, "Can Excel parse a function's param
> string for you?"
>
> Anyway, it's now moot. Who said necessity is the mother of invention?
> (Frank Zappa?)
>
> Because I've just written the code to parse a function's param string.
>
> It wasn't easy, but it wasn't as difficult as I'd feared either. You
> need about a half-dozen simple subroutines. No recursion seems to be
> needed.
>
> Unless I'm mistaken, there are 3 basic cases you have to deal with:
>
> 1. String w/out parens, and/or comma-delimited params only, a piece of
> cake: abc,def,ghi
>
> 2. String with paren-delimited params but no CDP's, also pretty easy
> (altho' your initial cut *cannot* of course be by commas. You must
> locate the first left paren, then call find its balancing right paren,
> and go from there): abc(def(ghi,jkl)),mno(pqr)
>
> 3. String with both paren- and comma-delimited params--not as easy,
> but again, not that much more difficult than 2. All you do is, having
> located the first left paren, which already did, you also see if it is
> preceded by a comma. If so, then you know you've got CDP's preceding
> your PDP's: abc,def,ghi(jkl(mno)),pqr
>
> I will post it in this group as soon as it's tested a bit; hopefully
> in a day or two.
>
> Thanks again.
>
> ***
>