Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
kenmo
23
Years of Service
User Offline
Joined: 7th Sep 2002
Location:
Posted: 4th Dec 2003 02:29 Edited at: 27th Jun 2012 05:48
Could someone post some examples of how to use lists, especially queues? Like adding and deleting from them. I decided to finally begin my first real project in DBP, making a new version of my DBC media player from scratch. I figured the playlist would be much more simple with queues, but the example programs with DBP barely show how to use them. Help is appreciated!
The Big Babou
23
Years of Service
User Offline
Joined: 10th Feb 2003
Location: Cyberspace
Posted: 4th Dec 2003 02:49
try searching the codebase for queue or stack. IanM was so kind to put up some examples

... they call it a royale with cheese ...
kenmo
23
Years of Service
User Offline
Joined: 7th Sep 2002
Location:
Posted: 4th Dec 2003 03:04 Edited at: 27th Jun 2012 05:48
Ah yes I forgot about that, I dont use this forum too much.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 4th Dec 2003 19:47
Hmmm, I never did get around to putting a list example together ... I'll try and get that put together and posted tonight to complete the set
Jaze
22
Years of Service
User Offline
Joined: 20th Nov 2003
Location: Connecticut, USA
Posted: 5th Dec 2003 01:01
I'm curious about these too - lists (add/append/insert... if there is a counter you can query to track its own size, and where you are in a list) Would be very valuable if its fast for code reusability issues.

I have an AWESOME set of list management like this written in pascal (from scratch cuz the out-the-box stuff was cryptic and useless...you had to make the rest of the class using there "names"...I wrote one from scratch and it has over 400 downloads - that is my programming library as a whole - with the lists and stuff)

Go on programmers heaven and search for "Sage" - See the Sage API for FreePAscal? There are 123 DL's from this site alone. (My other site is a backdoor that advertised only in forums: http://www.wimbleoffice.com/cgi-bin/nph-sageapi3dev

-=/Jaze/=-
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 5th Dec 2003 03:16
I posted it a little earlier into CodeBase - take a look.

The code just uses an array of integers, but you can easily substitute a type if you need to.

If you need to know your current position within a list, then you'll need my array plug-in (as detailed in the comments at the top of the example code).

Lists, queues and stacks are all just mapped onto arrays, as you will discover by checking the function at the bottom of the code.

Login to post a reply

Server time is: 2026-07-26 20:14:34
Your offset time is: 2026-07-26 20:14:34