Page 1 of 1

Posted: Sat Oct 20, 2001 3:40 pm
by BackupUser
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

Posted: Sat Oct 20, 2001 5:35 pm
by BackupUser
Restored from previous forum. Originally posted by fred.

In fact there is a little bug in the compiler about @LinkedListName(). Just use *He = LinkedListName() and it should work perfectly. Should be fixed in the next release.

Fred - AlphaSND

Posted: Sat Oct 20, 2001 7:30 pm
by BackupUser
Restored from previous forum. Originally posted by richard.

hi,

doesn't work

case 1:

NewList TestList.tableNode()
*He = TestList()
ResetList(*He)


case 2:

NewList TestList.tableNode()
*He = TestList()
ResetList(He)


thanx for your help

richard

Posted: Sat Oct 20, 2001 8:30 pm
by BackupUser
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

Posted: Sat Oct 20, 2001 9:22 pm
by BackupUser
Restored from previous forum. Originally posted by richard.

hi,
i want to create several lists and then use their pointers to work on them.

richard

Posted: Sat Oct 20, 2001 9:29 pm
by BackupUser
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