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.

Newcomers DBPro Corner / [DBP] Requesting help with file checklist and file loading

Author
Message
Merk
18
Years of Service
User Offline
Joined: 5th Feb 2006
Location:
Posted: 15th Jul 2006 12:07
Hi,

I've written some code that will search a particular directory and load any file within that directory to be prepared as a texture and button:



with the make_panel() function as follows:


At first when I ran this it all seemed to be going very nicely, however, after checking through the Panel() array I found that the Panel(x).no and x itself were not matching. This is causing problems for me as when I go to check if any of these texture buttons are being selected, I use a for-next loop which requires that the Panel(x).no be sequential. Now I'm pretty sure the reason it isn't working as I'd like it to is the information that the checklist quantity() command is returning. In order to load only files and not directories I've put a line in that does not select files with a '.' as their last value. This it seems is causing the g variable to skip a few numbers in the for-next loop.

Does anyone have any suggestions on how to code this so that the sprite numbers which are used are sequential?

Thank you in advance,
Merk.
fds
18
Years of Service
User Offline
Joined: 15th Jul 2006
Location:
Posted: 15th Jul 2006 18:04
You have to understand Dark Basic Pro is for basic programmers nots "Pros".

In short, your solution lay in your own code... check it out.

sdfs
Merk
18
Years of Service
User Offline
Joined: 5th Feb 2006
Location:
Posted: 16th Jul 2006 04:22
eh?
Dream And Death
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: The circus! Juggling job, kids and DBPro
Posted: 16th Jul 2006 11:02
Make an array from the checklist and bubble-sort it!

"You get what everyone gets, you get a lifetime!" - Death, The Sandman Library

First you Dream, then you ... - Neil Gaiman, 2001

Login to post a reply

Server time is: 2024-11-26 15:44:56
Your offset time is: 2024-11-26 15:44:56