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 / Can DBP do this??? (If it can... *Laughs Insanly*)

Author
Message
SpellSword
22
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Cyberspace
Posted: 22nd Feb 2003 01:52
Alright, I think I saw something about DBP doing this but
I could be wrong.

Does the editor have the ability to place several lines
of code in a group/folder/directory thing?

(Example)
Normal:
001 -Code-
002 -Code-
003 -Code-
004 -Code-
005 -Code-
006 -Code-

Lines 003-005 inside a folder and closed:
001 - Code
002 - Code
003/005
------------------------------------------
When I dream, I carry a sword in one hand,
and a gun in the other...
SpellSword
22
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Cyberspace
Posted: 22nd Feb 2003 01:53
What the... it didn't post my message right!... Let me try
gain...
------------------------


Alright, I think I saw something about DBP doing this but
I could be wrong.

Does the editor have the ability to place several lines
of code in a group/folder/directory thing?

(Example)
Normal:
001 -Code-
002 -Code-
003 -Code-
004 -Code-
005 -Code-
006 -Code-

Lines 003-005 inside a folder and closed:
001 - Code
002 - Code
003/005 <------(In a Folder)
004 -Code-
005 -Code-
006 -Code-

(I know it doesn't look like that, I'm trying to describe
what I think I saw that it can do.)

If it can do this I can make Text based games so much
easier!

(By putting each room in it's own folder, I won't have to
scroll to find it, just keep all the rooms I'm not working
with closed/minimised!)

Can it do this?
Am I making any sense?

If it can do this, I'll switch off DB and convert my
currant projects to DBP!!!

*Returns to coding in DB*

------------------------------------------
When I dream, I carry a sword in one hand,
and a gun in the other...
SpellSword
22
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Cyberspace
Posted: 22nd Feb 2003 01:54
Much better, that was weird. It cut off half my post?!?

------------------------------------------
When I dream, I carry a sword in one hand,
and a gun in the other...
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 22nd Feb 2003 01:58
In answer to your last question, no, not really.

Do you mean the function folding within the editor? You can collapse a function so that only the function header line shows.
Oxygen
22
Years of Service
User Offline
Joined: 4th Feb 2003
Location:
Posted: 22nd Feb 2003 03:16
You can stick subroutines in different files and have those files anywhere. So you can have subroutines for one portion of code in one file and others in another file. As long as they are all in the project manager files list, you can call them from anywhere. I like to have a "main.dba" and set that for my main project file at the top of the files list. Then include the files that do different stuff.

SpellSword
22
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Cyberspace
Posted: 22nd Feb 2003 04:20
Function folding? Whats that? Could you give a brief
description and where I can locate it in the editor IanM?

Thanks Oxygen, that makes alot of sense! It could be very
helpful with what I'm doing. (Easier to find everything.)


------------------------------------------
When I dream, I carry a sword in one hand,
and a gun in the other...
The Communist
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Cyberspace
Posted: 22nd Feb 2003 04:28
functionfolding is a feature that automatically adds a little symbol (+/-) before your function declarations. you can then collapse/expand the entire function so that either you see all of the code, or you see only the function declaration

Workers of all lands, Unite!
SpellSword
22
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Cyberspace
Posted: 22nd Feb 2003 04:34
ok.... That actualy sounds exactly like what I'm looking
for. Two questions though:

(1)
What is a Function declaration.
(I'm new to programing in general. )

(2)
Will it collapse multipal lines of code into a singal line
with a header/title?
(If a Function thingy is a singal line then I guess this
question is pointless.)

------------------------------------------
When I dream, I carry a sword in one hand,
and a gun in the other...
SpellSword
22
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Cyberspace
Posted: 22nd Feb 2003 04:44
I might as well ask this now.

When Oxygen said I could 'call' other files what command is
that?

(I think I heard of something or other called GoSub? but
that was DB not DBP.)

Example of my way of think on this.

------<Legend>------
M=Main/Primary file.
O=File to be called.
X=Nothing at all (Just filling space to make the text image)
Lines=The files are tied/connected/called by the main file.
------<Legend>------

O--M--O
XX/|\XX
X/X|X\X
OXX|XXO

------------------------------------------
When I dream, I carry a sword in one hand,
and a gun in the other...
SpellSword
22
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Cyberspace
Posted: 22nd Feb 2003 04:45
Oops...

(Reworking, that didn't look right...)

O--M--O
XX/|\XX
X/X|X\X
OX|XXO

------------------------------------------
When I dream, I carry a sword in one hand,
and a gun in the other...
SpellSword
22
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Cyberspace
Posted: 22nd Feb 2003 04:46
Ack again!

O--M--O
XX/|\XX
X/X|X\X
OXXOXO


Wish this forum had an edit/preview button.

------------------------------------------
When I dream, I carry a sword in one hand,
and a gun in the other...
SpellSword
22
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Cyberspace
Posted: 22nd Feb 2003 04:47
This should do it...
(Ack I'm not too good a forum text art)

O--M--O
XX/|\XX
X/X|X\X
OXOXO

------------------------------------------
When I dream, I carry a sword in one hand,
and a gun in the other...
Oxygen
22
Years of Service
User Offline
Joined: 4th Feb 2003
Location:
Posted: 22nd Feb 2003 04:47
example:

-= main.dba file =-

do
gosub thegamepart
loop

-= game.dba file =-

thegamepart:
make object box 1, 4, 4, 4
return

a function is different. You can read about them in the principles portion of the help file.

SpellSword
22
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Cyberspace
Posted: 22nd Feb 2003 04:52
This is almost as good (If not better) then folders for the
lines of code!!!

Thanks a million!

(Return sends it back to the file/program that it was sent
from with the GoSub command right... if that is true you've
just given me the tool I need to do an incredable amount
of new stuff with!)

------------------------------------------
When I dream, I carry a sword in one hand,
and a gun in the other...
SpellSword
22
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Cyberspace
Posted: 22nd Feb 2003 04:57
If I compile the main/primary file that has GoSub commands
will it snatch up all the other files that are attached to
it via the GoSub commands and include them in one .exe?

(Just making sure.)

*Splits his currant project into 400 files instead of one
mile long file.*

This is going to be so much more easy now!

THANKS!

------------------------------------------
When I dream, I carry a sword in one hand,
and a gun in the other...
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 22nd Feb 2003 07:16
try this...



that is a function... and it folds down
i'd use GoSubs (subroutines) as they're intended, if you don't understand that - then checkout the examples within the help.

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 22nd Feb 2003 13:30
To expand:

function void() <-- declaration (bit that says "this is a function"
`// private declaration
waste as boolean
waste2 as float
endfunction


And by clicking the "-" next to the declaration it will collapse into

function void()

And the editor? That's just the built in editor, comes with DBP.

Visit [url]www.lightning-systems.co.uk[/url]
You are the th person to view this signature.
SpellSword
22
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Cyberspace
Posted: 22nd Feb 2003 21:55
Thanks that helps alot.

*Cracks open his DB help file and begins reading*

------------------------------------------
When I dream, I carry a sword in one hand,
and a gun in the other...

Login to post a reply

Server time is: 2025-05-18 23:07:20
Your offset time is: 2025-05-18 23:07:20