LinkedListEx question

Just starting out? Need help? Post your questions and find answers here.
quasiperfect
Enthusiast
Enthusiast
Posts: 157
Joined: Tue Feb 13, 2007 6:16 pm
Location: Romania
Contact:

LinkedListEx question

Post 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) 
Registered user of PureBasic
quasiperfect
Enthusiast
Enthusiast
Posts: 157
Joined: Tue Feb 13, 2007 6:16 pm
Location: Romania
Contact:

Post by quasiperfect »

can anyone sugest a replacement lib atleast ?
thanks in advance
Registered user of PureBasic
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

So why don't you use PB's linked lists?
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post 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
quasiperfect
Enthusiast
Enthusiast
Posts: 157
Joined: Tue Feb 13, 2007 6:16 pm
Location: Romania
Contact:

Post 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. :)
Registered user of PureBasic
Post Reply