IonicWind Software

IWBasic => General Questions => Topic started by: pistol350 on August 28, 2008, 05:56:32 AM

Title: Question for Larry (McCaughn) about his Linked List Libary
Post by: pistol350 on August 28, 2008, 05:56:32 AM
Hello Larry!

Using your Library, I just wondered how to read data at a given position in a list.
I may be wrong but it seemed to me that none of the commands receive parameters.
I meant parameters to set a given position.
I know that you can move through the list using the Get(First/Last/ Prev/Next) commands then use the ReadData one to access the data in the current node.
But how to know which node of the list it is and more importantly how to set the position of the node to be read?

Actually i was searching for an equivalent for Ebasic's ListGetData command.
Title: Re: Question for Larry (McCaughn) about his Linked List Libary
Post by: LarryMc on August 28, 2008, 10:35:47 AM
My linked list does not have an equivalent of the ListGetData
You can read the point with the class member:
Quotem_pCurPos   pointer   Protected - An internal pointer to the currently selected node in the list.
but you can't do anything with it.
Looks like a feature oversight on my part.
I already have a ReadData so I need to make a ReadDataPos
I'll put it on my list of things to do.

Currently I'm working on my custom button control library which will let you create buttons with over 200 shapes(as of today); solid colors/gradient colors(multiple zones)/bitmaps.  Along with that is a designer that lets you pick and choose all the options and then generates the necessary coding for you.

So I'll have to finish it before I mess with the Linked List again.

Larry
Title: Re: Question for Larry (McCaughn) about his Linked List Libary
Post by: pistol350 on August 28, 2008, 12:48:23 PM
Ok Larry thank you for answering.

Like many others i am looking forward to seeing your other projects complete.
Title: Re: Question for Larry (McCaughn) about his Linked List Libary
Post by: LarryMc on August 28, 2008, 12:52:35 PM
I know I'm slow as mud but that's what chronic fatique does to you with a bad ticker.

But, I woke up this morning so I'm having a GREAT day! ;D

So, are you telling me if I add that feature you'll use my linked-list?
Hate to go to the trouble and noone use it.

Larry
Title: Re: Question for Larry (McCaughn) about his Linked List Libary
Post by: pistol350 on August 28, 2008, 06:34:16 PM
I said i would and i do use it. 8)
I've been trying something lately using the linked list library.
In fact i thought i could use datas in a linked list to solve my Sprite Z order problem i talked about not long ago.
The idea to iterate through the linked list and determine which data should be displayed first and so on woks great for me.
That's what i currently use the linked liist for.But there is a wide range of things i can use the linked list for.
So don't worry about it to be useful or not as it is obviously very useful.

Thanks again for sharing your work
Title: Re: Question for Larry (McCaughn) about his Linked List Libary
Post by: Guilect on September 07, 2008, 06:58:56 PM
@pistol350,

could you share your linked list sorting routine?
Please.   :)
Title: Re: Question for Larry (McCaughn) about his Linked List Libary
Post by: pistol350 on September 08, 2008, 03:32:08 AM
Hi Guilect!

Do you mean my routine in the context of the Sprite Z order stuff ?
Title: Re: Question for Larry (McCaughn) about his Linked List Libary
Post by: Guilect on September 08, 2008, 05:14:15 AM
@pistol350,

precisely.

I have been thinking of doing something like that myself.
I thought of using a bubble sort method.
It would be great to see what you did.
Title: Re: Question for Larry (McCaughn) about his Linked List Libary
Post by: Boris on September 10, 2008, 06:29:05 PM
Use a hidden listview with @LVSSORTDESCENDING style.
Title: Re: Question for Larry (McCaughn) about his Linked List Libary
Post by: LarryMc on October 21, 2008, 11:35:15 AM
Pete
Are you still needing another function added to my LinkedList class?

From the preceding discussion as I understood it:
you were wanting a function that would allow you to plug in the pointer to a node and have it return the data associated with that node.

The pointer value you would plug in would be obtained at some previous time using the GetFirst/Last/Next/Prev functions and storing that value somewhere of your choice.

Is that correct?

Larry

Title: Re: Question for Larry (McCaughn) about his Linked List Libary
Post by: pistol350 on October 21, 2008, 02:31:28 PM
Yes that's right Larry.
Title: Re: Question for Larry (McCaughn) about his Linked List Libary
Post by: LarryMc on October 21, 2008, 02:44:29 PM
ok,

I'll start looking into it tonight.

Larry
Title: Re: Question for Larry (McCaughn) about his Linked List Libary
Post by: pistol350 on October 21, 2008, 02:52:13 PM
Thank you very much.
That's very kind of you.
Title: Re: Question for Larry (McCaughn) about his Linked List Libary
Post by: LarryMc on October 21, 2008, 03:20:06 PM
Pete

Got a functional question.

There's 2 ways I can accomplish the request.

1.  get data from desired node without any impact on the list's current node pointer
(means if you are in the middle of some getnext loop you could interrupt the loop to go get data with the previously stored pointer then resume th getnext where you left off.)

2. get data from the desired node and at the same time set the list's current node pointer to that particular node.
(means the next getnext or getprev would start at that node you forced it to.)


3. I could do both.
   getdatapos(pos)
   getdataposmove(pos)


What do you think?
What best serves people's needs?

Paul's doesn't move the current node pointer as such.#1

Is there any advantage to having #2 ?

There is defintely a danger to do #2.
Since it would change the current node pointer you could very easily send the program off into never-never land
by passing it a node pointer for a node that had been deleted for some reason.

I hesitate to implement it for that reason.  I'm looking for a good argument to add #2.

Larry
Title: Re: Question for Larry (McCaughn) about his Linked List Libary
Post by: pistol350 on October 22, 2008, 02:35:11 PM
Sorry for not answering earlier.

err, i have to admit that this question is quite relevant.
Well, i think that number 1 is what everyone would be after for a simple use of Lists' capabilities.
However number 2 can also be useful depending on the project people are dealing with.
As far as i am concerned, number 1 may do the job.

Thanks again for spending  time on this.