Hello Everyone!
I've written this 'Keywords_Extract' Function (The function process a string, separates the words and returns the results to and undefined array.) many times and have finally come up with a version that seems to be stable and preform exactly how I need it to. However, I'm concerned about the required ErrorHandler: that I have written to make the code execute properly.
Once the code reaches the statement:
the code returns a subscript out of range error due to passing the undefined array to the Ubound Function. I initially expected this to return False or 0 but this does not seem to be the case. To correct the problem I have written in some Error Handling that assumes on Error 9 the Keyword_List array has not yet been defined and defines it. Though this works, I'm concerned about making an assumption.
Is there any way return the value 0 (zero) from an undefined array or check if Error Code 9 was result of the specified undefined array?
I want to eliminate the ErrorHandler as a requirment or modify it so it's not assuming the error was caused by the undefined array. I do realize that I could probably define the array to 1 after the initial Dim statement and it may produce the desired results however, it doesn't feel like the best solution. (I could be wrong though.).
Any suggestion, comments, or ideas would be appreciated.
Thanks in advanced.
The following 2 functions are used to remove multiple spaces from the beginning and end of a string.
Bookmarks