Gentee Programming Language > Documentation > Libraries Download documentation

Associative arrays - hash tables

Variables of the hash type allow you to work with associative arrays or hash tables. Each item in such an array corresponds to a unique key string. Items are addresses by specifying the corresponding key strings.

  • Operations
  • Methods

    Operations

    Operations defined for the variable of hash type are listed below. The second column contains possible statements where typename is a variable or an expression of the specified type.
     
    OperationSyntaxReturn typeComments
    Variable descriptionhash name
    hash name of type
    -Hash array description. If no item type is specified, uint is used.
    []hash["key string"]item typeGetting an item by a key string. In case there is no item, it will be created automatically.
    ** hashuintGet the number of items.
    foreachLooking through all items with the help of the foreach operator.

    foreach cur, myhash
    {
       ...
    }

    foreachLooking through all keys with the help of the foreach operator.

    foreach cur, myhash.keys
    {
       ...
    }

    Methods

    hash.clearClearing a hash array
    hash.createCreating an item with this key
    hash.delDeleting an item
    hash.findFinding an item
    hash.ignorecaseIgnoring the letter case of keys
    hash.sethashsizeSet the size of a value table


     Copyright © 2004-2006 Gentee Inc. All rights reserved.