Restored from previous forum. Originally posted by richard.
hi,
this example doesn't work - why?
NewList TestList.BasicStructure()
AddElement(TestList())
*He = @TestList()
TestList()\Field2 = 1
AddElement(TestList())
TestList()\Field2 = 2
AddElement(TestList())
TestList()\Field2 = 3
;ChangeCurrentElement(TestList(), *He)
; MessageRequester("Number of elements in the list:", Str(TestList()\Field2), 0)
MessageRequester("Number of elements in the list:", Str(CountList(TestList())), 0)
ResetList(TestList()) ; Reset the list index before the first element.
what i would like to be able to do, is to use a pointer of a linked list in the function ResetList(TestList()) like ResetList(*He)
thanx for yout help
richard
linked lists problem
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by fred.
Ho, I misunderstand your question. ResetList() like any other list function, need a linkedlist. It's not possible to use a pointer with it. The pointer can be only used with ChangeCurrentElement(). Why do you need to use a pointer inside ResetList() ?
Fred - AlphaSND
Ho, I misunderstand your question. ResetList() like any other list function, need a linkedlist. It's not possible to use a pointer with it. The pointer can be only used with ChangeCurrentElement(). Why do you need to use a pointer inside ResetList() ?
Fred - AlphaSND
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by richard.
rlp,
create for expl. 10 lists - save the pointers, which will be handed over to funtions to perform certain operations on them. such as pointer 4 (list 4) move to first - move to position 1500 and get the value (or user defined value).
remember the hash question?
regards
richard
rlp,
create for expl. 10 lists - save the pointers, which will be handed over to funtions to perform certain operations on them. such as pointer 4 (list 4) move to first - move to position 1500 and get the value (or user defined value).
remember the hash question?
regards
richard