Quantcast
Channel: WinDev Forum
Viewing all articles
Browse latest Browse all 1914

[WD20] How to check if an element exist in an Associative Array with structures (3 replies)

$
0
0
Hello All:

I have an Associative Array with Structures and I have problem when I try to access an element which doesn't exist. For example, if I do;
myArray[mykey].member
gives me an error if mykey is not yet in the array...

The problem, however, is how to check if the key element exist before trying the access. I'm using a FOR EACH loop with Key = mykey and checking if there is any iteration after it, but I would like to have a more efficient way to check if the element exist.

I would appreciate any help or comment.

Thanks in advance
Gus

Viewing all articles
Browse latest Browse all 1914

Trending Articles