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 / placing directories sorta thing

Author
Message
Shady Simpson
23
Years of Service
User Offline
Joined: 15th Mar 2003
Location: United Kingdom
Posted: 6th Apr 2003 00:52
hi,

I'm tryin to print all the files in a certain directory to the screen.

so I tried this:

set dir "C:\"
set cursor 100,100
dir

but all that happens is the first file prints where I want it to but the rest just go to the left hand side underneath the first file.

How could I get all the files positioned at the same place?

thanx.

(hope you can understand my explanation, it's hard to explain)
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 6th Apr 2003 01:22 Edited at: 6th Apr 2003 01:23


I hope this works, it prints the names out one after another, inserting a comma between each, much more flexible than the DIR command.

Current Project: Retro Compo. Entry.
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 6th Apr 2003 01:45
Note, if you don't want to print the whole dir structure out in one place then just don't append the string in each loop.

Current Project: Retro Compo. Entry.
Shady Simpson
23
Years of Service
User Offline
Joined: 15th Mar 2003
Location: United Kingdom
Posted: 6th Apr 2003 11:40
Well thanx for the reply but I get the error,

"string overflow error"

I don't know if it's part of your code or what because I don't know what that means.

do you or anyone else know how i can do this.

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Apr 2003 12:56
That's because you are using DB Classic which has a string limit of 255 characters. In future, why not use the forum for that language?

Just change Robs code to print the string immediately:

Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 6th Apr 2003 13:09
Sorry Shady, I thought that you were running DBP - the strings there can have an infinite length.

Current Project: Retro Compo. Entry.
Shady Simpson
23
Years of Service
User Offline
Joined: 15th Mar 2003
Location: United Kingdom
Posted: 6th Apr 2003 13:30
right it's workin now.

but that wasn't what i wanted, i wanted something more like this:

| Documents and Settings
| Program Files
| Windows
| Dark Basic

so it lists down all the files one after another but staying at the same x coordinate.

What happens in that code is :

Documents And Settings, Program Files, Windows, Dark Basic.

Please can someone help!

Shady Simpson
23
Years of Service
User Offline
Joined: 15th Mar 2003
Location: United Kingdom
Posted: 6th Apr 2003 13:32
well I have bought DBPro just it's shit.

It doesn't work so I'm workin with DB Classic while waitin for a replacement CD.

MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 6th Apr 2003 13:37
Well, I brought DBPro quite a while ago, and its great.

It works very well, so I'm staying with it (especially as I dont have DB Classic).

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 6th Apr 2003 14:46
Shady,

in which case you need to copy each entry into an array, then print each item to the screen, but moving the Y position each time.

Current Project: Retro Compo. Entry.
Shady Simpson
23
Years of Service
User Offline
Joined: 15th Mar 2003
Location: United Kingdom
Posted: 6th Apr 2003 16:39
ok i'll try that.

thanx everyone

Login to post a reply

Server time is: 2026-07-11 04:22:51
Your offset time is: 2026-07-11 04:22:51