5.4. Exists

[<<<] [>>>]


This function should be used to get the information if a given key exists in the hash. This is different than checking the value assigned to the key comparing against undef, because the key may exist and have an assigned value of undef. The function returns true if the key exists in the hash and returns false if the function does not exist in the hash.

If the function is used with a single argument representing the handle to the hash the function checks that the iteration pointer is pointing to an existing key. This feature should be used to check the end of an iteration.

import hash.bas

h = hash::New()

for i=1 to 10 hash::SetValue h,"q"&i,i next i

hash::Start h while hash::Exists(h) print hash::ThisKey(h)," ",hash::ThisValue(h) print hash::Next h wend

hash::Release h @end examoke

[<<<] [>>>]