MarksStoreArray class

From m204wiki
Jump to navigation Jump to search

The MarksStoreArray class was written for Marks and Spencer a UK retailer. The index for MarksStoreArray items is a a three-digit Marks and Spencer store code so is not likely to be useful to anyone other than Marks and Spencer.

The MarksStoreArray class is a limited collection class — the declaration of a MarksStoreArray variable requires an Of clause follow by a datatype, where the datatype can only be a String, Float, or Fixed datatype. As such, it is considerably less useful than the NamedArraylist class. It's main advantage over NamedArraylists is that all collection items are stored in STBL so that the access path for a MarksStoreArray object is very efficient, indeed, and so can be useful in situations where there is heavy access to lots of different string or numeric values, based on frequently changing store codes.

However, if the items in a collection are, themselves, objects the MarksStoreArray cannot be used and, instead, a NamedArrayList should be used, with the store codes as the "names" (index values). List of MarksStoreArray methods lists all the methods in this class.


The following example sets the value of an item associated with store code ABC to 22:

begin %quantity is collection marksStoreArray of float %quantity = new %quantity('ABC') = 22 end