Work with HashTables (key+value pairs) with ease in AppGameKit with this drop in include file.

Contains the following functions.

  •     HashLoad(table, filepath) - Loads a saved HashTable
  •     HashSave(table, filepath) - Saves a HashTable to disk
  •     HashSetString(table, key, value) - Sets a string value
  •     HashSetFloat(table, key, value) - Sets a float value
  •     HashSetInt(table, key, value) - Sets a integer value()
  •     HashGetString(table, key) - Gets a string value
  •     HashGetFloat(table, key) - Gets a float value
  •     HashGetInt(table, key) - Gets a integer value
  •     HashCount(table) - Counts the number of hash pairs
  •     HashRemove(table, key) - removes a hash pair
  •     HashGetKey(table, index) - Gets the name of a key by its index

Example Usage

Add items
global myHash as HashPair[]
for i=0 to 5
 HashSetString(myHash, "key "+str(i), "Value "+str(i))
 HashSetFloat(myHash, "key "+str(i), 3.2)
 HashSetInt(myHash, "key "+str(i), i)

Get Values
for i=0 to HashCount(myHash2)
    print(HashGetString(myHash2, HashGetKey(myHash, i)))
    print(HashGetFloat(myHash2, HashGetKey(myHash, i)))
    print(HashGetInt(myHash2, HashGetKey(myHash, i)))    


Product Details

Artist: PartTimeCoder
Category: AppGameKit Scripts
Sub Category: Game Code
Sales: 2

Engine Support

AppGameKit Yes

File Formats

AppGameKit Code .agc


No comments yet

You must Login or Register to leave comments.

Related Products