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 / gui file browser closes w/o warnning

Author
Message
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 20th Jul 2009 11:37
using db pro. I don't know if there is a file browser app/ plug in but i started making one a few years ago. and took along break from codeing. I opened up one of my old project for a file browser it has alot of promis but i gave up on it after many days of scratching the program is not complete but works perfectly except for one small problem it closes without warning when i try to swap directories
ill attach the files needed and the code its kinda heavy at least for me and honestly i dont remember how it works completely was alot better back then. None of the buttons work so once u select a dir hit enter to go to it. also is an attached exe of it working incase u have trouble with my code mabey it will encourage u enough to work on it a litle more. Also i havnt gotten to puting icons next to file types yet sry


A child's dream never dies.

Attachments

Login to view attachments
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 20th Jul 2009 11:51
<--noob was my 2nd or 3rd project went from drawing sprites to this. Its what burnt me out and quit db prolly to much of an undertaking for my programming level. but it would be greatly appreciated if someone could work out the bugs. i spent heaps of time on this and its a burden over my head got so close.

A child's dream never dies.
zeroSlave
15
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 20th Jul 2009 18:25 Edited at: 20th Jul 2009 18:26
I downloaded and ran the code. The first thing that happened was a bad variable was reported.

I'm pretty sure that you can't define a variable as a number. It needs to start with a letter or a word.
4#
5#
6#
...etc
These Won't do.

I changed each of these to
Row4#
Row5#
Row6#
...etc


And it ran... until it couldn't find 'drvlst#'

I changed:



to:



Now, I know that 'drvlst#' should exist because the code 'get's the image near the beginning. Since I couldn't solve this issue quickly(i'm at work), I just put a 'if sprite exist (drvlst#)=1 ... endif' to at least get the code to run...

Aha!! It worked. The application popped up and I had a list of what was in my 'program files' directory. Once I clicked on the directory combo box, I could then click and highlight files... However, I could not change directories..? It never closed on me, either.


Anyway, below are some tips that I have found useful, and have noticed might have burnt you out. I hope you don't take it personally. I only wanted to share.

I changed the 'SET WINDOW LAYOUT 0,0,1' to 'SET WINDOW LAYOUT 0,1,2' so that I could move it around while I was testing it. (this can be changed when the app is ready to launch for commercial use... )




Is much more aesthetically pleasing and organized as:



I would group commands together with some spaces so that it looks a little cleaner. This will also make it easier for your debugging purposes as well as for others that might be debugging. I commend you on your remarks, however. That is a habit that I have been slowly picking up. (shooting myself in the foot!)





It looks cool! As far as your programming level... There is some pretty good stuff in here. I would keep it up if I were you. This could be a handy function for people in the community to use when saving, loading games/pics/etc.
Cheers!
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 21st Jul 2009 11:54
Yeah i tried to have someone work on it in the past and they said the same thing about my variables i think my dbpro version is a bit older and it allows them without any problem. cudos for working so hard to fix it so other people can work on /test it

yeah that was the problem i was having as well seems simple enough to be able to change the directories from the click$ string but it doesnt. would always close on me when i tried to use it thought mabney the loop was bad but i couldnt find anything wrong with it.

that was my point ages ago when dark basic was still kinda new it was such a pain to brows folders either for games or apps and i wanted to build a browser for the community. Eventually if i can ever get that bug fixed ill have it auto add icon files and folder icons to directories and build some simple save function/import for peeps. could just link to it like an external function from inside the program,it would be awesome when finished. i also have a working windows menu system function that u can call in apps that i built doesnt use any image files i havnt seen anyone really looking for one in the community though.

buy the way i have no idea how to use debugg on dark basic doesnt seem to do anything for me. like i said im still noob first prograaming language other than html witch really doesnt count

A child's dream never dies.
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 21st Jul 2009 12:00
and btw drvlst# was just a variable i declared at line 9 at the beggining so at line 19 "create bitmap drvlst#,261,70" bitmap would have a value dont see what coulda gave u the error

A child's dream never dies.
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 21st Jul 2009 12:25 Edited at: 21st Jul 2009 12:36
Holy crap!
i ran the code u modified and the program still wasnt working right cause the "row" u added to the variables messed it up cause the variables werent chaned in teh for next loops so i went in and added and "A" next to every variable in the program and magic bro it works ffs so simple i just had bad variable declarations this whole dam time heres the new code run this stuff knock yourself out man its great also at the end of the source i was always tring to navigate using set dir clic$ and apprently it was looking for a root directory instead of the director it waws already in plus the new one so that was a big problem to ill have to chang that as well

go ahead and change the window layout again if u want its back to norm woot! I never woulda though my variables where the problem dark basic always accepted and ran them w/o a problem. just because the enjine runs it doesnt meen the car is going to right? lol ah this program killed it for me man and it always is something simple like that.

ill add a back function later for easier browsing and a drive list fix up the ui mabey multiple skins for xp/vista users
and change the fixed directory im very exicted now. btw do u know if anyone else has made a browser yet for dbpro?

2 or so years ago i posted this same prob and only responses i got was from someone telling me i couldnt use checklist() in the manner i was trying. i had my doubts "spits at that guy" lol

A child's dream never dies.
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 21st Jul 2009 12:56 Edited at: 21st Jul 2009 13:10
i can switch directories now buy typing
set dir "c:program files"+clic$
its all fine and good like that but u wont be able to look at anything ouside the root program files directory so i tried to do

dir$=get dir$()
if returnkey()=1
set dir dir$+clic$
endif
but it keeps telling me invalid path i tried a few variations like adding
dir$+""+clic$ and
dir$+clic$+".dir" ect. it needs to know what director it is in to be able to navigate

as u can see in the above post
set dir "c:\program files"+clic$
works just fine

A child's dream never dies.
zeroSlave
15
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 21st Jul 2009 23:53 Edited at: 21st Jul 2009 23:54
Well, I have played a little more, but I am getting errors with Sprites and Image numbers. I will see if I have time to mess with it tonight when I get home from work.

Are you using DBPro? or DB? If Pro, I would suggest getting the update. It's quick, and you will have more luck with others testing it if you have the same version as them. A while back, I had spent a plethora of time making an app in an OOOOOOld version of DBP (900+ lines) and it didn't work when I upgraded. It had more errors than I was ready to debug. I was pissed.

Also, before I go, try doing a:


before:


This way, it will print to the screen what the actual string value is before it gives an error. It could be a simple fix!
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 22nd Jul 2009 07:57 Edited at: 22nd Jul 2009 16:34
Alright updated my dbpro version first time in years try this should run i ran into same sprite pro with drvlst ect corrected it only thing left to do is have it switch dirs



A child's dream never dies.
zeroSlave
15
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 22nd Jul 2009 20:27 Edited at: 22nd Jul 2009 20:30
smerf:


I just fiddled with the code at the bottom, putting it in functions, and such. I made a:

change and saw that it worked. so, I tested a pause and...

I don't know why, but it seems that if it has a short delay, it works. Maybe DBP is trying to change dirs before the value is updated internally? It seems really odd, but you might fool around with it a bit and see what comes of it?
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 22nd Jul 2009 22:47
Thanks heaps bro changed the keystate to a simple wait command witch i wont need eventaully cause ill have to have a double click timer in there anyhow to test for a mouse double click

well that's pretty much it code seems to run good now works perfect

A child's dream never dies.

Login to post a reply

Server time is: 2024-11-25 04:42:48
Your offset time is: 2024-11-25 04:42:48