Hi there,
I’ve written a script for generating text from information supplied in Excel.
The script works fine however I’m just in the process of adding some error handling.
I have a subroutine that generates the text from the parameters passed in. It’s these parameters I’m wanting to check.
I call the subroutine like this:-
generateText(“W,A,D,E”, “<@interReg>,<@interReg>,<@interBold>,<@interReg>”, “T,N,T,T”>
As you can see there are three parameters in this example each containing 4 parts, each part separated by a comma:-
“W,A,D,E”
“<@interReg>,<@interReg>,<@interBold>,<@interReg>”
“T,N,T,T”
What I’d like to is check that each parameter contains the same number of parts up to a maximum of 8.
I originally wrote some code that takes the number of text items in each and multiplies them together so the answer should be 4x4x4 = 64 in the example above. If the answer is something different then this would indicate that’s there’s a problem. Of course there are some anomalies with this approach.
One main problem with this method is that I was using text item delims to check the number of parts in each.
This meant that so long as there were 3 commas in each (using the example above), the validation would see the correct number of parts to each parameter, which is incorrect.
If any one can understand what I’m trying to do please can they suggest a better method of validation.
I’d like to make the script as water tight as possible for other users.
Thanks in advance.
Regards,
Nick
Browser: Safari 419.3
Operating System: Mac OS X (10.5)