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 Professional Discussion / display current dirs

Author
Message
DarkBasic Pro Guy
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location: Broomfield, Colorado
Posted: 16th Nov 2004 09:07
I'd like to know if there's a command or plugin or something that will load current directorys from drive A to a variable

Thanx in advance

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 16th Nov 2004 09:13
you can do
Set Dir

Then lookup the file commands to cycle throught the list. Then use Get File Type.. That returned certain values for the "selected" file or folder.

Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 16th Nov 2004 09:14 Edited at: 16th Nov 2004 09:14
Not as a command no. You could use

perform checklist for drives
perform checklist for files

Or write a file manager code. (Or use this.)


It stores all files (and folders) in BrowseFile$(Index)

PS thank Lee Bamber For this Code, It's from one of his example programs for DBC

1800+ XP - GeforceFX 5600 - 256MbDDR - 60Gb Hdd - XP Pro
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 16th Nov 2004 09:24
I use this:



To generate a neater list of media into a text file for me to copy and paste into the project file so I dont have to keep clicking add new file, etc.

Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 16th Nov 2004 09:30
But does it do folders? Mine does.

1800+ XP - GeforceFX 5600 - 256MbDDR - 60Gb Hdd - XP Pro
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 16th Nov 2004 09:40
That code doesn't but it can be modified.

Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 16th Nov 2004 10:44
Mine already does! he he he

1800+ XP - GeforceFX 5600 - 256MbDDR - 60Gb Hdd - XP Pro
DarkBasic Pro Guy
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location: Broomfield, Colorado
Posted: 17th Nov 2004 00:00
well mobiius I added that function at the very top of my code and then I at the bottom said



and when I did that well it opened and everything but without me pressing a key, moving the mouse, I didn't touch anything (except my desk, and chair) and then it just closed.

@Nicholas Thompson
I will try yours

Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 17th Nov 2004 01:21 Edited at: 17th Nov 2004 01:21
Browsefile$ is an array!
You need to

Also, use
to set a current directory.

1800+ XP - GeforceFX 5600 - 256MbDDR - 60Gb Hdd - XP Pro
DarkBasic Pro Guy
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location: Broomfield, Colorado
Posted: 17th Nov 2004 04:11 Edited at: 17th Nov 2004 04:15
ok well under the function I put



and all it did was open and close very quickly

Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 17th Nov 2004 06:51
strange the wait key should have styopped it

http://free-space.myftp.org for free ftp
website hosting and e-mail 60mb for ftp/webste 70mb for e-mail
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 17th Nov 2004 08:17
Sounds like its crashing. Check for a crash log either in the program folder you are running it from, OR in the C:\ drive.

DarkBasic Pro Guy
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location: Broomfield, Colorado
Posted: 17th Nov 2004 12:04
ok well I can't find one

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 17th Nov 2004 20:48
Ok, I dont like giving people their answers as you dont learn so much.. but here it is:



Basically, you set the directory, point to the first file/folder.. Check its type. If its 1, its a folder.. so print it.. If its more than -1 (-1 = nothing left, 0 = file, 1 = folder) then find the next and loop around.

Hope it helps!

anomer
20
Years of Service
User Offline
Joined: 11th Oct 2004
Location: City of Tears
Posted: 17th Nov 2004 23:23
i'm probably wrong but it seems to me that if you added the function at the top and called the function at the bottom it wouldn't even hit that bottom code block b4 exiting. just a guess.

~fades
DarkBasic Pro Guy
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location: Broomfield, Colorado
Posted: 18th Nov 2004 15:22
ok thanx nicholas thompson I will try to learn something from that code.

Login to post a reply

Server time is: 2025-05-28 05:23:55
Your offset time is: 2025-05-28 05:23:55