here are a few other LIST methods worth looking into (from an earlier thread)
' LIST METHODS
Strict
Global n$
Global list$
Global mylist:Tlist
Global this_func = 1
Global link_count
Global this_link:Tlink
Global total_funcs = 5
Global listfunction$
Local timer
Const WAIT_TIME = 25
Global GH = 640 ; Global GW = 480 ; Global GD = 0
Graphics( GH,GH,GD )
Global a$[] = ["one","two","three","four"]
mylist:Tlist = ListFromArray(a$)
For n$ = EachIn mylist
list$ = list$ + n$ + " "
Next
listfunction$ = "ListFromArray"
Repeat
Cls
timer:-1
If timer < 0 Then timer = 0
If MouseDown(1) And timer = 0
changefunction()
timer = WAIT_TIME
EndIf
SetScale 1,1
SetColor 255,255,255
DrawText "Click Mouse",MouseX(),MouseY()-48
SetColor 255,255,255
DrawText this_func,MouseX(),MouseY()-32
SetColor 255,255,0
DrawText listfunction$,MouseX(),MouseY()-16
SetScale 1.5,1.5
SetColor 255,0,0
DrawText list$,MouseX(),MouseY()
Flip
Until KeyHit(KEY_ESCAPE)
Function changefunction()
this_func:+1
If this_func > total_funcs Then this_func = 1
Select this_func
Case 1
mylist:Tlist = ListFromArray(a$)
listfunction$ = "Mylst.ListFromArray(Array)"
Case 2
this_link:Tlink = ListFindLink(mylist,"three")
mylist.insertbeforelink("2-1/2",this_link)
listfunction$ = "Mylist.InsertBeforeLink(object,link--'three')"
Case 3
this_link:Tlink = ListFindLink(mylist,"three")
mylist.insertafterlink("3-1/2",this_link)
listfunction$ = "Mylist.InsertAfterLink(object,link--'three')"
Case 4
mylist:Tlist = ListFromArray(a$)
listfunction$ = "Mylist.ListFromArray(Array)"
mylist.remove("three")
listfunction$ = "Mylist.remove('three')"
Case 5
mylist:Tlist = ListFromArray(a$)
link_count = mylist.count()
listfunction$ = "Mylist.count() = "+link_count
End Select
list$ = ""
For n$ = EachIn mylist
list$ = list$ + n$ + " "
Next
End Function