The idea is to fill in 2-d-array to virtual listview so i start with a string-array,
DIM sData(Rows, Columns) As String
Enum Columns
col_Index
col_Name
col_Alias
col_GUID
col_GeneralClassificationGroup
col_SpecificSubgroup
' ...
End Enum
the columns will contain different properties generic like Index, Name, Alias, Group etc.
The order remains by index (1st column) and i have a couple of different property-types but some as the group here will appear multiple times and i have all the groups ( maybe one hundred) that are readable groupnames separate from the actual data stored in a hash-class where an abbreviation is the key for the groups name and the target-array currently holds all the abbreviations.
So it is with all the other groupy-thing, category, types that all come to a separate column of my listviews that's why i want to put it all together into the virtual listview upon an array that has bit more than a million elements in first dimension (=rows)
i think to fill in the real groups names instead of creating a lookup-table for the user to check what is "AXr", what stands "PSC" for - what does "UNR" mean?
it were more user-friendly to let the listview show complete names and not torturing users to point on anything they want to read .
More tables next to this one were an overkill also so the columns should hold all information without the need to lookup somewhere else again.
Now to fill in all strings to the array would blow up the used memory to an ernormus number if every little 3-char-abbrev becomes the 5 to 35 chars that it stands for in thousands of rows
Butthe names are present in strings and this listview is strictly a lookup-table - nothing will be changed by the user - i thought if i manipulate the pointers that all with the abbrev "AXr" is read as the content from the hash-bucket thats key is "AXr" so internally i will memorize the original value in StrPtr(sData(row, column)) and overwrite the original that it points the hash-bucket .
I remember from - meanwhile deprecated - dictionary-module that these buckets were equal to BString preceeded by a dword , telling how many bytes in the bucket.
So the buckets pointer was a perfect replacement for a stringpointer
But cHash does not expose its pointer, and it were great if would not need store the length in front as
htGeneralGroup.Add( sKey, mkdwd$(Lenf(sValue)) & sValue )
'htGeneralGroupt is 1 hashtable of 8 or 9 tables containing all possible names for a certain column
that without knowing the pointer is pretty useless - where couldd i peek my dword now to know the length ?
So i need to copy the content of the bucket and that kills the advantage of a fast working hash-table
i need to allocate a local buffer just to "measure" the content of every bucket. (=Len).
For a search-query different than with a key also - if i know the table content is UTF8 encoded and what i search has at least 10 cyrillic chars: i would not need to pull objects from the shelf with less than 20 bytes.
Need Bucket-Ptr and perfection is when previous to a pointer a 32 bit integer-value holds the size of content at Ptr.
btw. Did you know:
actually the advantage of utf8 is not to detect for a programmer - as the danger in UTF16 :
to stay on the safe side for any kind of encoding you must pre-allocate 4 bytes per char
when you intend to store zero-terminated or fixed as String * number
UTF16 (Wide) is as UTF8 varying in size. It can be 2 or 4 bytes per char (surrogates)
Bookmarks