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.

DarkBASIC Discussion / Loading Files Interface

Author
Message
Captain America
20
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 26th Jul 2006 03:11 Edited at: 26th Jul 2006 04:19
Im trying to make a database type program for me and some friends to keep track of data.

I can save and load the file with no errors, but I would like to make the load file function a little more user friendly.

right now i simply use the 'cd "C:blahblahblahhblaa"' command to set the directory

and then the 'dir' to show all the files.

then i have an input for you to type in the name of the file, and if you type it in wrong it say "Error incorrect filename" and then gives you another chance to type it in right, and if you do then it loads fine.

but i would like to make it so that you can click on the name to load it like in Professional games.

I would also like to have it just show the filename without the extension.

Is there an easy way to do this?

Cheers!

Cap'n


Cheers,
Capt. America
Captain America
20
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 31st Jul 2006 02:23
anyone?


Cheers,
Capt. America
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 2nd Aug 2006 21:03 Edited at: 2nd Aug 2006 21:12
ok, all I can think of off the top of my head is the extention thing. Basically, when you find out what the name of the file is, and before you print it on the screen you would use this code (string$ is the name of the file)

this should work. You could also just simply remove the last 4 digits(so that you remove the . too) but that would create a problem if the extention is more than 3 digits. This doesn't happen very often, but sometimes programs will use their own special files with longer extentions


for your other question, about clicking on the names (i am not sure exactly how to do this but i will give you what I think would work), you would need a way to create/use a scrollbar (don't ask me how...i don't know). Also, since you know how tall a message can be (don't know off the top of my head but not hard to figure out), you can take a screenshot of the screen after the dir command(save bitmap command) and then(using the get image command) grab the different lines of text as images (so that you can check for collision with your mouse). You would grab as many images as there are files (for->next loop using a counting variable that you found when you first printed the list on the screen). There is probably a better way to do this but this is all that I could think of.


hope this helps!
Captain America
20
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 3rd Aug 2006 04:14
OK thanks for the help on the extension part, I can definately fix that now, and thanks for the help on the other part, I get your idea, and understand partly how to do it, but not exactly sure.

I'll give it a whirl though, thanks!

Cap'n


Cheers,
Capt. America

Login to post a reply

Server time is: 2025-05-25 06:18:19
Your offset time is: 2025-05-25 06:18:19