Main Menu

CDicObj

Started by Richard Kelly, May 02, 2026, 04:21:59 AM

Previous topic - Next topic

Richard Kelly

Quote from: José Roca on May 03, 2026, 06:40:57 PMI have DWstrList and DVarList:

https://github.com/JoseRoca/AfxNova/blob/main/docs/String%20Management%20/Linked%20Lists.md



PB supports:

ILinkListCollection.ADD method adds am item to the end of the LinkListCollection.
ILinkListCollection.CLEAR method removes all items from the LinkListCollection.
ILinkListCollection.COUNT method returns the number of items currently in the LinkListCollection.
ILinkListCollection.FIRST method sets the current index for the LinkListCollection to one (1) and returns the previous value.
ILinkListCollection.INDEX method sets the current index for the LinkListCollection to the specified value and returns the previous value.
ILinkListCollection.INSERT method adds the specified item to the specified index position..
ILinkListCollection.ITEM method returns the item from the specified index position.
ILinkListCollection.LAST method sets the index value to the last item and returns the previous value.
ILinkListCollection.NEXT method returns the next item in the LinkListCollection.
ILinkListCollection.PREVIOUS method returns the previous item in the LinkListCollection.
ILinkListCollection.REMOVE method removes the item at the specified position from the LinkListCollection.
ILinkListCollection.REPLACE method replaces the item at the specified position with a new item in the LinkListCollection.

This old PB code I'm looking at uses:

Count, Clear, Item, Replace, Add

I think I'll move forward with DVarList and DWStrList




José Roca

#16
I have made mine indexed, allowing to work as if they were arrays.

' // Retrieve and print the results
FOR i AS LONG = 1 TO List->Count
   PRINT List->Item(i)
NEXT

Therefore, First, Last, Next, Previous and For Each aren't needed.

Although DVarList can be used with any data type, because it uses variants, DWStrList is optimized to work with DWSTRING and it is much faster when you only need to use strings.

I also have safe arrays, both dynamic and fixed size (vectors).

https://github.com/JoseRoca/AfxNova/blob/main/docs/COM%20/DSAFEARRAY%20Class.md