View Single Post
 
Old 02-23-2020, 10:26 AM
Jennifer Murphy's Avatar
Jennifer Murphy Jennifer Murphy is offline Windows XP Office 2007
Competent Performer
 
Join Date: Aug 2011
Location: Silicon Valley
Posts: 234
Jennifer Murphy is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
The code I supplied in post #21.

That code was based on your original specification:

and requires each parameter to be preceded by '=' and, except for the last, to be followed by ','. The order in which they occur is critical - regardless of whether you supply the keywords (which aren't actually necessary for the parsing). For example, the code cannot possibly know which is the column and the row if you use:
3, 1, 215, 199, 244
or:
1, 3, 215, 199, 244
unless you stick to a specified order. Yes, you could just pass a string of numbers separated by whatever character you choose (e.g. just a space or a comma) but, even so, the order would remain critical.

It seems you're using something different from what we've discussed. It's a bit hard to develop code if you're shifting the goal posts like that.
Perhaps I was not as clear as I could have been. Sorry about that. Written discussions are fraught.

Once you showed me how to have a parameter string in the document, it was always my intention to have keyword parameters that could be coded in any order and for all of them to have default values in case no parameters at all are passed.

The general syntax is something like this:

Code:
TblHiLite: [Column=C|1] [Headers=H|1] [RGB1=R,G,B|255,255,255]
           [RGB2=R,G,B|219,229,241] [MatchCase=Yes/No|Yes]
My code handles that by breaking the entire string into tokens delimited by spaces. It then breaks each token into a keyword and value delimited by "=". If the keyword matches one of the defined ones, the value is used.

The order doesn't matter and none of them are required. This is a very flexible syntax and easy for the user (me) to use.
Reply With Quote