MarksStoreArray class: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
Line 4: Line 4:


However, if the items in a collection are, themselves, objects the <var>MarksStoreArray</var> cannot be used and, instead, a <var>NamedArrayList</var> should be used, with the store codes as the "names" (index values).
However, if the items in a collection are, themselves, objects the <var>MarksStoreArray</var> cannot be used and, instead, a <var>NamedArrayList</var> should be used, with the store codes as the "names" (index values).
[[List of MarksStoreArray methods]] lists all the methods in this class.
===Example===
===Example===
The following example sets the value of an item associated with store code <code>ABC</code> to 22:
The following example sets the value of an item associated with store code <code>ABC</code> to 22:

Latest revision as of 19:46, 4 February 2011

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.

Example

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