|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Jan SchulzBlog Authors: Jan Schulz |
How to test if an array is initialized?
Jan Schulz
|
|
Tags: 
lotusscript
array
|
Comments (1)
I like to write code like this:
|
A tag is a keyword that is used to categorize an entry. To view the entries with a particular tag, click a tag name or enter a tag in the box.
The tag cloud indicates the frequency of tag use. Popular tags appear darkest. The slider control adjusts how many tags are displayed in the tag cloud.
1 Erik Werfel Permalink I've seen the technique of initializing only when necessary referred to aslazy
initialization , and it's a pretty cool technique.
Unfortunately, there doesn't seem to be a simple way to determine
whether a dynamic array as been redimmed.
You have a couple of options: trap the uninitialized array error,
and redim only when you get the error; or have a flag variable that
you set when you redim the array, and check the flag before
redimming.
The 8738 you see as the datatype of your array is telling you that
you have an array of user-defined objects -- 8704 for the dynamic
array plus 34 for the user-defined objects. There's a note at the
bottom of the help entry:
So I think that's working as documented.