Help Center
Help CenterAfxNovaString Management

DWStrList

Members (14)

Documentation

DWStrList

DWStrListimplements an indexed doubly-linked list for the DWSTRING (Unicode dynamic string) data type.

Include file : DWStrProcs.inc

Usage examples

Using the dotted syntax:

' // Build the linked list
DIM List AS DWStrList
List.Add("Result 1")
List.Add("Result 2")
List.Add("Result 3")
List.Insert(1, "New string")
List.Replace(2, "Replaced string")

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

Using NEW and the pointer syntax:

' // Build the linked list
DIM List AS DWStrList PTR = NEW DWStrList
List->Add("Result 1")
List->Add("Result 2")
List->Add("Result 3")
List->Insert(1, "New string")
List->Replace(2, "Replaced string")

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

' // Delete the list
Delete List

Methods

NameDescription
AddAppends an item to the list.
ClearEmpties the entire list.
CountReturns the number of items in the list.
InsertInserts an item at the specific index.
ItemRetrieves the item at the specified index.
RemoveRemoves the specified item from the list.
ReplaceReplaces the item at the specified index.

DVarList

DVarListimplements an indexed doubly-linked list for the DVARIANT (dynamic variant) data type. A DVARIANT can contain any kind of data except fixed-length string data (if you pass it as the input it will be converted to a unicode dynamic string).

Include file : DVariant.inc

Usage examples

Using the dotted syntax:

' // Build the linked list
DIM List AS DVarList
List.Add("Result 1")
List.Add("Result 2")
List.Add("Result 3")
List.Insert(1, "New string")
List.Replace(2, "Replaced string")

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

Using NEW and the pointer syntax:

' // Build the linked list
DIM List AS DVarList PTR = NEW DVarList
List->Add("Result 1")
List->Add("Result 2")
List->Add("Result 3")
List->Insert(1, "New string")
List->Replace(2, "Replaced string")

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

' // Delete the list
Delete List

Methods

NameDescription
AddAppends an item to the list.
ClearEmpties the entire list.
CountReturns the number of items in the list.
InsertInserts an item at the specific index.
ItemRetrieves the item at the specified index.
RemoveRemoves the specified item from the list.
ReplaceReplaces the item at the specified index.

Add (DWStrList)

Appends a string to the list.

FUNCTION Add (BYREF dws AS DWSTRING) AS LONG
ParameterDescription
dwsThe string to append.
Return value

Returns the number of items in the list.


Clear (DWStrList)

Empties the entire list.

SUB Clear

Count (DWStrList)

Returns the number of items in the list.

FUNCTION Count () AS LONG
Return value

Returns the number of items in the list.


Insert (DWStrList)

Inserts an item at the specific index.

FUNCTION Insert (BYVAL idx AS LONG, BYREF dws AS DWSTRING) AS BOOLEAN
ParameterDescription
idxThe one-based index where to insert the item.
dwsThe string to insert.
Return value

If the method succeeds, it returns TRUE; otherwise, FALSE.


Item (DWStrList)

Retrieves the item at the specified index.

FUNCTION Item (BYVAL idx AS LONG) AS BOOLEAN
ParameterDescription
idxThe one-based index of the item to retrieve.
Return value

If the method succeeds, it returns TRUE; otherwise, FALSE.


Remove (DWStrList)

Removes the specified item from the list. Indexes are one-based.

FUNCTION Remove (BYVAL idx AS LONG) AS BOOLEAN
ParameterDescription
idxThe one-based index of the item to remove.
Return value

If the method succeeds, it returns TRUE; otherwise, FALSE.


Replace (DWStrList)

Replaces the item at the specified index.

FUNCTION Replace (BYVAL idx AS LONG, BYREF dws AS DWSTRING) AS BOOLEAN
ParameterDescription
idxThe one-based index of the item to replace.
dwsThe replacement string.
Return value

If the method succeeds, it returns TRUE; otherwise, FALSE.


Add (DVarList)

Appends a VARIANT to the list.

FUNCTION Add (BYREF dv AS DVARIANT) AS LONG
ParameterDescription
dvThe VARIANT to append.
Return value

Returns the number of items in the list.


Clear (DVarList)

Empties the entire list.

SUB Clear

Count (DVarList)

Returns the number of items in the list.

FUNCTION Count () AS LONG
Return value

Returns the number of items in the list.


Insert (DVarList)

Inserts an item at the specific index.

FUNCTION Insert (BYVAL idx AS LONG, BYREF dv AS DVARIANT) AS BOOLEAN
ParameterDescription
idxThe one-based index where to insert the item.
dvThe variant to insert.
Return value

If the method succeeds, it returns TRUE; otherwise, FALSE.


Item (DVarList)

Retrieves the item at the specified index.

FUNCTION Item (BYVAL idx AS LONG) AS BOOLEAN
ParameterDescription
idxThe one-based index of the item to retrieve.
Return value

If the method succeeds, it returns TRUE; otherwise, FALSE.


Remove (DVarList)

Removes the specified item from the list. Indexes are one-based.

FUNCTION Remove (BYVAL idx AS LONG) AS BOOLEAN
ParameterDescription
idxThe one-based index of the item to remove.
Return value

If the method succeeds, it returns TRUE; otherwise, FALSE.


Replace (DVarList)

Replaces the item at the specified index.

FUNCTION Replace (BYVAL idx AS LONG, BYREF dv AS DVARIANT) AS BOOLEAN
ParameterDescription
idxThe one-based index of the item to replace.
dvThe replacement variant.
Return value

If the method succeeds, it returns TRUE; otherwise, FALSE.