David,

Doubtless you'll have coded this by now, but certainly in the situation you
describe, I'd store just the 'as typed' case version of the list on disk,
then immediately after read, I'd create an in memory 'all uppercase' version
in one go - just UPCASE the whole attribute - and I'd probably RAISE it to
because I like working with multi-attributed lists in preference to
multi-valued.  Then, for each insert into the list I'd LOCATE BY 'AL' the
UPCASEd version of my new name in my UPCASEd complete list, SETTING an
attribute index position and then INS before the relevant attribute in my
UPCASEd list and before the relevant value in my 'as typed' array.

The CPU overhead of UPCASEing the whole name list should not be much because
it is a single pass through a string applying a simple transformation with
no growth or shrinkage involved.  The risks involved in maintaining 2
parallel lists on disk along with the messiness of that solution would be
enough to rule that option out for me.

Cheers,

Ken

David Wolverton wrote:
> The issue for me is that I am using the list of employees within a
> program - so Virtual Dictionaries are not an option - displaying the
> data.  I certainly don't want to sort it on use each time, which
> means I need to do an insert BY "AL" -- but in order to do that I
> have to have the list ready on read, but I insert names into the list
> one at a time -- hence I throught I would have to maintain two
> attributes -- one 'as keyed' and one in 'sort case' -- my other
> choice is to UPCASE the 'as keyed' each time I have to do an insert.
>
> I guess that's my question:
>
> Which is better
>
> Write a record with two sets of data, one 'as typed' one strictly for
> sorting, so that on the next insert, I just create a sort version of
> the new name, and insert it in both lists. The downside here is the
> record is larger.
> OR
> Use UPCASE on each need to insert to build the 'insert array' as
> needed, find the insert position in that array, then insert the
> 'AsTyped'.  The downside to me was having to UPCASE each time an
> insert is needed.
>
> I'm trying to figure out the lesser of the evils!
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to