HashVal Property

 

Description

 

Returns the hash value for a specified key in a Dictionary object.

 

PowerBASIC Syntax

 

PROPERTY GET HashVal ( _

BYREF vKey AS VARIANT _

) AS VARIANT

 

Arguments

 

vKey

Key associated with the hash value being retrieved.

 

Return Value

 

VARIANT. The hash value for the key.

 

Example [PowerBASIC]

 

#INCLUDE "windows.inc"

#INCLUDE "scrrun.inc"

 

DIM pDic AS IDictionary

DIM vKey AS VARIANT

DIM vItem AS VARIANT

DIM vHashVal AS VARIANT

 

' Create an instance of the Dictionaty object

pDic = NEWCOM "Scripting.Dictionary"

' Add some key/item pairs to the dictionary

vKey = "a" : vItem = "Athens"

pDic.Add vKey, vItem

vKey = "b" : vItem = "Belgrade"

pDic.Add vKey, vItem

vKey = "c" : vItem = "Cairo"

pDic.Add vKey, vItem

' Get the hash value of the "c" key

vKey = "c"

vHasVal = pDic.HashVal(vKey)

 

Valid XHTML 1.0 Transitional