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 / Minimizing functions

Author
Message
Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 20th Oct 2014 21:57
On my editor I am using the option "folding functions", so that i can just minimize the functions i am not currently working and move faster to the lines i need, there is an option so that every time i open my file all the functions are already minimized? Otherwise every time i open the file i am working on i waste time by minimizing them all
ShellfishGames
13
Years of Service
User Offline
Joined: 6th Feb 2013
Location:
Posted: 22nd Oct 2014 17:13
I guess that depends on what editor exactly you're using. Is it the standard Synergy Editor? (You probably can check that in Help/About or something like that)

Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 22nd Oct 2014 20:39
No i am using the official one updated 2008, i do not use the Synergy Editor because folding functions does not work at all on that editor, even if is checked in the options.
By the way there are no options to achieve what i need
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 22nd Oct 2014 21:54
That is meta-data that would have to be stored in the project file (or another external file maintained by the editor). Chances are there's no support for saving it in the official IDE since I've never seen it generate such in the .dbpro file and it doesn't create any other files.

I for one usually don't use code folding; I prefer the line numbers to be linear so that I can better predict roughly where a certain line is.

Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 22nd Oct 2014 22:46
But when you have like 10000 lines of code is faster to move up and down having just 2 little pieces of around 100-200 lines each opened that going up and down wasting time scrolling the editor
Kingius Returns
12
Years of Service
User Offline
Joined: 17th Oct 2013
Location: UK
Posted: 22nd Oct 2014 22:57
You can also jump around your code by goto line number and using the find function for specific comments you've added (or labels or function names).
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 22nd Oct 2014 23:59 Edited at: 23rd Oct 2014 00:00
Quote: "No i am using the official one updated 2008, i do not use the Synergy Editor because folding functions does not work at all on that editor, even if is checked in the options."

Try to update it. Look here. It folds everything for me, it has fold all function. But it may be buggy while editing something near folded functions (screen not redraws but input works).

The "the official one updated 2008" totally sucks, it even can't compile EXE correctly. Pfft.

Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 23rd Oct 2014 00:55
jumping will not work because i don t remember the line i have to edit, i already have in my "brain ram" other stuff to care about line numbers.

For example, at the top of my code i have all the images loaded and objects and stuff, if i am editing a function where i load or modify some objects i neef for example the number of the object or the image i need, for example when i need to texture an object, and when i need for example to texture different limbs or/and using normal/relief mappings who use 2-3 textures for 1 limb, i need to go fast up and down from where i load the textures and where i need to edit the object, having the functions i dont need all minimized allow me to do this thing very fast just scrolling up and down the page, if i have to keep in mind line numbers probably when i come back to the edit object function i could forget the textures i needed to have in mind because i was too busy to remember the code line, my memory it s not the best so i cant keep up keeping in mind too many numbers at the same time (probably most of the people though), and that will also be a risk for making some mistakes, which is better avoid totally while programming, by the way it will be also slower than just scrolling up and down the page. This thing works already good for me, the only thing i was asking is if there is an options or a workaround to have all the functions minimized when i open my project file, instead of having to do it manually myself every time i open it.
For the 2008 editor, mr handy which problems give you when compiling?
Kingius Returns
12
Years of Service
User Offline
Joined: 17th Oct 2013
Location: UK
Posted: 23rd Oct 2014 09:19
Around 25 years of programming have taught me that the best way to structure code is to make it modular. This is not how I programmed when I first started!

In DBPro, this means using functions and avoiding Goto/Gosub and grouping functions conceptually into include files which become like libraries of code. This makes finding things a lot easier and reusing code between projects pretty painless too.
Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 23rd Oct 2014 20:19
So you suggest me to make 1 file for each function and include it in the project? It will be included in the exe right? because i don't want other people to steal my code.
Also talking about performances will be the same thing or doing that will be slower because the editor have to open a lot of files?
Kingius Returns
12
Years of Service
User Offline
Joined: 17th Oct 2013
Location: UK
Posted: 23rd Oct 2014 21:56
I'm suggesting grouping sets of related functions into files which you then include as part of the project. These are then all compiled together and included in the same exe automatically.

For example, I am making an RPG and I have a combat.dba file in which I am placing my combat related functions. I also have a textbuttons.dba file which has all of the functions for creating text on the screen and handling rollover effects and clicks for my dialog engine. Base string processing functions go into the strings.dba file, and so on.

This allows me to find things more easily and also to reuse the code between projects. In addition I can test specific parts of the code very quickly by creating a new project, adding just the include files I need and start testing the code.
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 23rd Oct 2014 22:21
From what I understand the Synergy Editor is built on top of or derived from Code::Blocks...

This page might help but it is up to you to give any plug-ins a go... had a quick look at the list but no folding plug-ins... maybe a longer search and look might unearth something...

http://www.codeblocks.org/cbplugins

GL

Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 24th Oct 2014 03:50
Quote: "It will be included in the exe right?"


Everything in the original input source code will in the resulting exe, but not in source form.


Quote: " because i don't want other people to steal my code."


The compiler translates your input source code into machine code. Even though the original source code doesn't exist in the output exe,it's still possible to disassemble (and/or) decompile this back into something an experienced programmer could decipher the original programs logic from, but to be honest, nobody is going to bother.

GreenDixy
17
Years of Service
User Offline
Joined: 24th Jul 2008
Location: Toronto
Posted: 27th Oct 2014 04:10
if you are really worried about people seeing your code you can use something like upx to pack your exe even further so takes a bit more to decompile it the only thing I do not know is if it is still picked up by av's awhile ago there was a argument/suit against the av company's trying to get it taken out of there database as it is a packer most packers are seen as a Trojan/virus even thoe upx is harmless.

.:: Http://DeanWorks.Ca ::.
My software never has bugs. It just develops random features.

Login to post a reply

Server time is: 2026-07-17 19:33:26
Your offset time is: 2026-07-17 19:33:26