UDF - Tables Library - RFC
Posted 04 June 2005 - 12:11 AM
A table is a 2-dimensional array, where the 2nd dimension is normally 2.
the value at  is a number telling the number of rows in the table.
The values at [x] are the keys (unique) and the values at [x] are the values associated with these keys.
An example of this is what is returned by the IniReadSection function.
I'm writing a UDF library to create a table, add key/value entrie(s), and to retrieve a value based on a key.
Has anyone else done something like this, or is there a set of functions to do this already out there somewhere? Any comments?
Posted 04 June 2005 - 12:18 AM
Don't argue with an idiot; people watching may not be able to tell the difference.
Posted 07 June 2005 - 12:21 AM
And here's the headers, since there isn't much documentation in the file itself (it's still a work in progress) I think they're pretty self-explainatory, but here goes:
;A table is created at default length if a length is not given
;If a table has no room for another key, then it will be increased by this size.
Func _TableCreate(ByRef $Table, $Length = -1, $Width = 2)
;This will create a new table in $Table
;This will verify that $Table is a valid table, and will return true/false
Func _TableSetValue(ByRef $Table, $Key, $Value)
;This will set $Key in $Table to $Value. If $Key doesn't exist, it is added
Func _TableGetIndex($Table, $Key)
;This will return the index in $Table where $Key resides. Do not save this value, as it could change if the table is compressed, sorted, or otherwise optimized.
Func _TableGetValue($Table, $Key, $Column=1, $Default='')
;Returns the value of $Key in $Table. Returns $Default if non-existant. $Key is case-insensative
Func _TablePrint($Table, $Delim=',', $EOL=@CRLF)
;This is a method for displaying $Table in ASCII mode. $Delim will be between columns, and $EOL will be added to the end of each line except the last one.
;This will return an array of the keys in $Table. =x and ..[x] are the keys.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users