Page 2 of 2

Posted: Mon Sep 22, 2003 9:15 pm
by Psychophanta
Ohhhh, some people support Saddam, or Bush, Osama, etc. but nobody support my noble cause for request for "Pointers admission for LinkedList functions".

:cry: :cry: :cry: :cry: :cry: :cry: :cry:

Posted: Tue Sep 23, 2003 1:21 am
by PolyVector
Hey Psychophanta, I believe you are wrong about my example being redundant... The linked list internally uses the *Next and *Previous pointers...
If you'll notice, I never assign a value to *Next or *Previous... This is done internally by PureBasic...
It can be proven...

This Code Works:

Code: Select all

Structure LinkedString 
  *Next.LinkedString 
  *Previous.LinkedString 
  value.s 
EndStructure 

NewList Hello1.LinkedString() 
NewList Hello2.LinkedString() 
*ptr.LinkedString 
*ptr=AddElement(Hello1()) 
*ptr\value = "Hello1, Item One"
*ptr=AddElement(Hello1()) 
*ptr\value = "Hello1, Item Two"
*ptr=AddElement(Hello1()) 
*ptr\value = "Hello1, Item Three"

Procedure PrintListContents(*ptr.LinkedString) 
  Repeat 
    If *ptr 
      Debug *ptr\value 
    EndIf 
  *ptr=*ptr\Next
Until *ptr=0 
EndProcedure 

PrintListContents(FirstElement(Hello1()))
It does NOT work if you change the Structure to this:

Code: Select all

Structure LinkedString ;Notice that *Next and *Previous are reversed
  *Previous.LinkedString 
  *Next.LinkedString 
  value.s 
EndStructure 
If I were just creating duplicate pointers it wouldn't matter what order they occured in the structure...

anyways... Let's stop going on about this because we both agree that better internal support is needed...

On to the Osama jokes: :)

Posted: Sun Sep 28, 2003 3:04 pm
by Psychophanta
Hi PolyVector.

Thanx to Kale and you.
Perhaps Fred can make something with this matter. :?: :)


AL