Page 1 of 1

LinkedListEx question

Posted: Thu Feb 21, 2008 4:52 pm
by quasiperfect
i use flype's LinkedListEx the latest beta of pb

after i use ClearListEx i can use AddElementEx ?
becasue i get a crash when i try to do that

example of code that creates a crash i'm sure i'm doing something stupid but i don't understand what

Code: Select all


Structure TipuriChestionare Extends LINKEDLISTEX
  id.l
  nume.s
EndStructure

Global *tipuri_list

*tipuri_list = NewListEx(SizeOf(TipuriChestionare))

Procedure creatlist(j.l)
  ClearListEx(*tipuri_list)
  For i= 1 To j
    *chestionar.TipuriChestionare = AddElementEx(*tipuri_list)
    *chestionar\id = i
    *chestionar\nume = Str(i)
    Debug CountListEx(*tipuri_list)
  Next i
EndProcedure

creatlist(6)
creatlist(5) 

Posted: Sat Feb 23, 2008 8:09 pm
by quasiperfect
can anyone sugest a replacement lib atleast ?
thanks in advance

Posted: Sat Feb 23, 2008 10:21 pm
by Trond
So why don't you use PB's linked lists?

Posted: Sat Feb 23, 2008 10:22 pm
by rsts
I've not used flype's lib, so I'm not sure of how it's used, but adding an element based on a pointer rather than an index, seems a little unusual to me.

Are you sure you're specifying things correctly?

And to suggest an alternative, it would help to know the overall objective.

cheers

Posted: Sun Feb 24, 2008 3:21 pm
by quasiperfect
thanks u bouth for responding i used flype's before and i got used to it so i never bothered to look at pb linked list lib it works great.
default's pb works great. :)