Navigation: battleWarden:Script > API Reference >

List

 

 

Due to lack of an integrated list data structure in eScript Basic, battleWarden:Script provides an external runtime module allowing you to create linked lists. The type of the lists you are able to create is not generic; you are limited to adding tables only.

 

List Module API

Syntax

Parameters

Return Value

Description

CreateList() AS INTEGERPTR

none

Pointer to the created list.

Creates a new list by allocating memory.

FreeList(list AS INTEGERPTR) AS VOID

list: specifies a pointer to an existing list.

none

Frees an existing list by deallocating its memory.

ListSize(list AS INTEGERPTR) AS INTEGER

list: specifies a pointer to an existing list.

Number of tables within the list.

Returns the number of tables added to the list.

ClearList(list AS INTEGERPTR) AS VOID

list: specifies a pointer to an existing list.

none

Removes all tables from the specified list. The list itself will not be deleted.

AddTable(list AS INTEGERPTR, table AS INTEGERPTR) AS VOID

list: specifies a pointer to an existing list.

 

table: specifies a pointer to an existing table.

none

Adds an existing table to the end of specified list.

GetTable(list AS INTEGERPTR) AS INTEGERPTR

list: specifies a pointer to an existing list.

Pointer to the current table.

Returns the current table stored in the list.

RemoveTable(list AS INTEGERPTR) AS VOID

list: specifies a pointer to an existing list.

none

Removes the current table stored in the list.

ResetListIteration(list AS INTEGERPTR) AS VOID

list: specifies a pointer to an existing list.

none

Resets the iteration of the specified list and jumps before the first table. Never use GetTable after calling this function unless you have called NextTable.

NextTable(list AS INTEGERPTR) AS INTEGERPTR

list: specifies a pointer to an existing list.

Pointer to the next list element. Returns 0 if there does not exist any next element.

Jumps to the next list element.

Copyright © 2020 solicus. All Rights Reserved. Last Update: 2020-5-25.