<<<<<<<<<<<<<<<<<

hash_table(prog_tools) Programming Tools hash_table(prog_tools)

NAME

hash_table - associate LYMB data values with strings

DESCRIPTION

The hash_table class stores key/value pairs for efficient retrieval. Data can be of any of the basic types (scalars, strings, pointers, or integers).

SUPERCLASS

object

INSTANCE VARIABLES

key is the string that will be used as the key when the next install: message is sent.

MESSAGES

value= value establishes a correspondence between value and the current key.

remove! removes the key/value pair associated with the current key from the hash table.

remove_all! removes all key/value pairs from the hash table.

installed? tests to see if there is an entry associated with the current key.

value? returns the value associated with the current key.

all_values? returns all values in the hash table.

keys? returns a list of all keys in the hash table.

number_keys? returns the number of keys (items) in the hash table.

EXAMPLE

hash_table new: error_hash key=`init_error' install:`INIT' key=`return_error' install:`RETURN' key=`decl_error' install:`UNDECL' key=`args_error' install:`ARGS' ;

motif_radio_box new: errors parent=`motif' create! ;

motif_toggle_button new: init_error

parent=`errors' @ `labelString' : `Unitialized Variable (INIT)' arm_action=`print_error_code' create! ;

motif_toggle_button new: return_error parent=`errors' @ `labelString' : `Missing Return Value (RETURN)' arm_action=`print_error_code' create! ;

motif_toggle_button new: decl_error parent=`errors' @ `labelString' : `Undeclared function or argument (UNDECL)' arm_action=`print_error_code' create! ;

motif_toggle_button new: args_error parent=`errors' @ `labelString' : `Wrong number or type of arguments (ARGS)' arm_action=`print_error_code' create! ;

actions new: print_error_code tick_actions=` error_hashunknown command: wh288 key= [motif current_widget?]unknown command: wh264 print:value ; ' ;

motif on! start!;

SEE ALSO

structure, array, xt_resource


Please send comments and suggestions to
consult@rpi.edu