Difference between revisions of "Hload"

From Scriptwiki
Jump to: navigation, search
 
Line 20: Line 20:
 
That one loads the section ''myusers'' of the ini called ''users.ini'' to hashtable users and displays the result.
 
That one loads the section ''myusers'' of the ini called ''users.ini'' to hashtable users and displays the result.
  
[[Category:Hash Table]]
+
[[Category:Hash Table]][[Category:Commands]]

Revision as of 21:24, 24 November 2005

Loads a table from a file.

/hload -sbni <name> <filename> [section]

These loads plain text from a text file, with item and data on separate lines.

Using the -s switch makes the command display the result (e.g. * Loaded hash table 'users' from 'users.dat')

The -b switch loads binary files.

You can use -n to load files as data only, with no items. When loading with -n each line of data is assigned an N item value, starting at N = 1.

The -i switch treats the file as an ini file. You can specify an optional section name after the filename.

Note that /hload does not create the table, it must already have been created by /hmake.

Example

hload users users.dat

This simple example just loads users.dat into a hashtable called users.

hload -si users users.ini myusers

That one loads the section myusers of the ini called users.ini to hashtable users and displays the result.