Advertisement
ASP_Volume2 VB function enhancement #35141

clsStackCollection

Cls StackCollection Use VB's Collections to build stacks and queues. Also included a safety wrapper for collections. To operate as a stack/queue you do not need a separate key, everything is done using the index This class adds new Methods and Properties to VB collections. ArrayFromCollection Put contents of stack into an array ArrayToCollection Load members of an array into the stack Bottom: Returns first value added to stack Clear: Empty stack in one call Exists: Tests if index/Key is in stack. Uses error trap to test Optionally runs silent if error occurs Extract: Remove any member from stack Invert: Reverse order of stack Max: Returns the highest alphanumeric member of stack Middle: Returns Middle member of stack Min: Returns the lowest alphanumeric member of stack. Pop: Use collection as a LIFO (Last In First Out) stack, removes member from stack. Pull: Use collection as a FIFO (First In First Out) stack, removes member from stack. Push: Wrapper for VB standard Add. Push is used by both LIFO & FIFO stacks. QuickSort: Sort stack into alphanumeric order RandomMember: Extract a random member of the stack(Optional RemoveIt as Boolean = False); if True remove from stack Replace: Change the Item for an Index/Key Shuffle: Randomise the contents of the stack Top: Returns last value added to array I have also included a class ClsSafeCollection which wraps the standard collection in a safety net Add: Modified to allow you to cope with the various error conditions that can occur Count: VB standard Collection.Count Item: Modified to allow you to cope with the 'Index/Key does not exist' error Remove: Modified to allow you to cope with the 'Index/Key does not exist' error Please comment and vote. May just have reinvented the wheel for many of you but hope you find some use for it. Feel free to use all or parts of this but leave copyrights in place and let me know about it at [email protected]

AI

AI 摘要: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

源代码
original-source
Upload
原始评论 (3)
从 Wayback Machine 恢复