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 / We Want Indent!!!

Author
Message
pugmartin
23
Years of Service
User Offline
Joined: 3rd Jan 2003
Location: United Kingdom
Posted: 10th Apr 2003 03:34 Edited at: 10th Apr 2003 03:37
Enough of all these fancy graphical doobries and boring bug fixes touted for coming versions of DBPro, We Want Indent!!!

Anyone remember Amos Pro?

Remember the little biddy `Indent` button?

Remember how great it was?

For those not in the know, the magical mystical indent button automatically formatted code in the editor from this:

do
if x=1
print g
for f=12 to 5 step -1
input d
y=y+d*f
next
endif
sync
loop
etc

to this:

do
..if x=1
..print g
...for f=12 to 5 step -1
....input d
....y=y+d*f
..next
.endif

sync

loop

etc

Without the full stops obviously. Silly posty box thing doesnt like spaces in posts (shoulda learnt that really from post earlier (the shambles i posted in the `Raven` topic...)) LOL

It may not look like much now, but you wouldnt believe the difference it made to large programs. And all at the touch of a button... Well, a magical one...

So come on people, start chanting now - We Want Indent!!!

That picture actually is me you know...
Can anyone post me a banana?
Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 10th Apr 2003 03:45
You need a button to format code that you should be indenting anyway? It's just good practise.. do it manually.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 10th Apr 2003 04:04
learn to love that tab button with all its buffering goodness

Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 10th Apr 2003 04:51
i generally use the tab button as that is the point in it to indent... if you want to change the value it indents by check the IDE options and change it from 3charactes to whatever

personally i like the auto-indent of VC++ but i don't doubt guy will have that added into the next IDE update ... i mean things i'd like to see are

function value popup - which is like say you have the function
RGB, well the popup would go [RGB(byte Red,byte Green, byte Blue)] and everytime you press ',' it highlights the next value.
but not just for the buildin DBfunction (which infact would be pretty hard from the DLLs unless thats what the description is for) but it could take the ones you make and if they have something inbetween the values then you can export that, without assignment it check for the # or $ if not its classes as an int

it's not a hard effect, just takes a while to code as its a pig trying to get all the permatations.

another one i'd like is the instant object dropdown, so say you declare a type like

type a_t a b c endtype
a as a_t

then you type a. and you'd get a drop down menu like
-------
| a [ ]
| b [ ]
| c [-]
-------
and you'd click on the type you want

perhaps the same with pointers, you do '*' and it'll come up with a menu of the pointers you've used

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?
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 10th Apr 2003 04:51 Edited at: 10th Apr 2003 04:56
how annoying it double posted... so now i've gotta think of something else to write instead.

erm... i forgot to add the auto indent for stuff like
do...loop
while...endwhile
for...next
repeat...until
if...endif | if...else...endif
select...case
etc

i mean it is a case of being lazy i guess, and not that it ever happens to me cause as soon as i press enter i do a 'tab' but it would be a convenince having them automatically do this, and not return until you close.

thats something which can get annoying after a tab... cause you press backspace and it takes away the tab you've done for the next set of code - so it kinda anoying at times.

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?
rapscaLLion
23
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 10th Apr 2003 06:00
Well I dunno, it could be a useful tool. I wouldn't think it would be incredibly hard to implement but I would really know.

I agree with Raven, although I've only really used VB's IDE (not VC++), I love the little popup boxes for everything.

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
GuySavoie
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location:
Posted: 10th Apr 2003 06:47
Enterprising young programmers could write an IDE plugin to pretty up their code with the IDE plugin structure right now.

Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 10th Apr 2003 06:50
i thought the IDE plugins were static not dynamic in structure... or is that what you're adding?
because it was confusing how you went from having the template plugin as part of the program to an external program.

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?
pugmartin
23
Years of Service
User Offline
Joined: 3rd Jan 2003
Location: United Kingdom
Posted: 10th Apr 2003 20:20
Yeah but come on people!...

You know what its like when you get carried away when typing something in a flash of inspiration! Before you know it youve gone twenty lines without even looking up at the screen...

I just wouldnt mind having the option thats all.

That picture actually is me you know...
Can anyone post me a banana?
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 10th Apr 2003 23:34
@Pugmartin

Find my "20 Line Expander" in the 20 Line Challenge forum, that will (almost) correctly indent code. (It accepts normal as well as 20-line compressed DBA's). I could turn this into an editor plugin probably.

Current Project: Retro Compo. Entry.
pugmartin
23
Years of Service
User Offline
Joined: 3rd Jan 2003
Location: United Kingdom
Posted: 11th Apr 2003 00:40
Y`know, i remember seeing the title of that post. That sounds great mate, ill try it out n let you know. Be even better if it were a plugin like... (hint hint)

That picture actually is me you know...
Can anyone post me a banana?
Hubdule
23
Years of Service
User Offline
Joined: 3rd Sep 2002
Location: Gundelsheim
Posted: 11th Apr 2003 00:59
To get indent ... simply get the DBPro Editor Power Tools:
http://www.colorarts.de/dbprotools/

After installation right click in the editor window ...
Hold down SHIFT and click on insert indent ... then you can set it up ...

GuySavoie
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location:
Posted: 11th Apr 2003 08:37
Look! An enterprising young programmer!

Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 11th Apr 2003 09:05
hmm... well first, shouldn't be upto the community to add this feature but more importantly i can't seem to get Hudule's Powertool indentor to work

the DBPro IDE one is oki, and will retain like it did in DarkEdit once you've done it ... but what we're asking for here is something where you go

if a=a
<->inc b
endif

and the IDE automatically indents with the first line after the IF without the then statement, and then removes the indent when you close using the endif

i kinda wish i understood howto setup Visual IDE 98 cause i'd love to use that instead, but the help conserning making plugins for it - well i've not found the help on that yet.
:: sighs :: this is why i end up learning so damn'd much, if you want something around here you end up doing it yourself... getting very trying.

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?
Hubdule
23
Years of Service
User Offline
Joined: 3rd Sep 2002
Location: Gundelsheim
Posted: 11th Apr 2003 09:28
What's the problem with VIDE98 ? If you've got a legal copy of it then just insert the disc, let the setup run, sit back and drink Tee

If you want to create plugins with the Power Tools SDK then just ask me and I'll try to help you

The Power Tools Indent wasn't made by me but the source is available so it shouldn't be a problem to change that. Oh and what problems do you have with the Power Tools setup ? It couldn't be easier ? Just let me know and I'll see what I can do

Hubdule *the enterprising young programmer* LOL

Dave J
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 11th Apr 2003 09:28
Yeah, those popup boxes for functions were great in VB.

"Computers are useless they can only give you answers."
Hubdule
23
Years of Service
User Offline
Joined: 3rd Sep 2002
Location: Gundelsheim
Posted: 11th Apr 2003 09:32
just wait a little bit as GuySavoie is working on an updated IDE x-d

Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 11th Apr 2003 14:24
Hubdule's tool works fine for me but it is very slow with large files. If I try with anything over 1000 lines then after about 5 seconds it just crashes.

My 20-Line expander works instantly but something is going wrong somewhere because it sometimes adds indents when it shouldn't and is OK for small files (<300 lines) but messes up with large projects (> 1500 lines). I think that I need to re-do the code for it.

@Hubdule

How do you get / change the text in the editing Window?

Current Project: Retro Compo. Entry.
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 11th Apr 2003 14:30
Aha - Found the problem, it isn't ignoring comment-lines as it should.

Current Project: Retro Compo. Entry.
Hubdule
23
Years of Service
User Offline
Joined: 3rd Sep 2002
Location: Gundelsheim
Posted: 11th Apr 2003 14:58
@ Rob K ... If you want to get the editor's content get the ActiveX DLL I've written and included in the source package @ the Power Tools page. It's a MMF wrapper to get the editor content.

Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 11th Apr 2003 21:58
lol the problem with Visual IDE98 is i don't know howto set it up to use DarkBasic Commands or the Compiler etc...
i mean there's a plugin thing so you can like choose what language you code in within the help - but i'm not sure howto use it.

i'd be happy if someone could develop one cause i love how Visual IDE works
just don't have the knowlage to achieve it myself is all - and the help isn't helpful about expanding.
tried msdn online, but keep hitting brickwalls

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
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 11th Apr 2003 22:14
I was about to indignatly point out Hubdule's fantastic free tools, but it seems he beat me to it They're a real lifesaver for me. All the code I write is indented, with one click of a button x-d

I've had them since I first heard about them and all I can say is well done

How can you have missed them? They were on a sticky topic for ages?

Actually, I've just had a thought - it won't really be too hard to make somthing like this - you could have a running total of how many "tabs" to have at the beginning of each line, then every time you encounter, say, "do" inc this amount and every time you encounter a command such as "loop" you dec this amount.

I was surprised Rich didn't recommen the plugin, I thought he would have known about it

You are the th person to view this signature.
Programmers don't die, they just Gosub without return....
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 11th Apr 2003 23:10
"Actually, I've just had a thought - it won't really be too hard to make somthing like this - you could have a running total of how many "tabs" to have at the beginning of each line, then every time you encounter, say, "do" inc this amount and every time you encounter a command such as "loop" you dec this amount."

It is a little more complicated than this but that is the basic principle. You have to deal with comment lines (ignore them) and various other issues. For example if it is an "if", you have to work out if it is an "if...then" statement, in which case don't increase the indent etc. That is the basic idea though.

Current Project: Retro Compo. Entry.
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 12th Apr 2003 00:06
i'm kinda getting confused... how exactly is this indent function working for all of you guys?

because i setup the indent and it does bugger all for me, and if i want to indent a section of code you highlight from the end and make sure you highlight the whole of the first line to the gutter... then press tab.
if i understand what ya'll are saying thats exactly what your trying to do.

me want someone to make a plugin for Visual IDE 98 for this, i mean someone teach me the basics of how to add language support in it then i'll make the thing ... but i don't even know that much

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?
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 12th Apr 2003 00:16
Hmm, I just right click anywhere in my code, without highlighting at all, go to Power Tools > Insert Indentation.

Easy

Though I prefer to do it manually.

Current Project: Retro Compo. Entry.
pugmartin
23
Years of Service
User Offline
Joined: 3rd Jan 2003
Location: United Kingdom
Posted: 15th Apr 2003 20:51
Hubdule, thats really great. Thanks!

Anyone reading this post, i recommend downloading this right away. Very useful.

(Especially if, like me, yer lazy!!! Bloody TAB key, no way!)

That picture actually is me you know...
Can anyone post me a banana?

Login to post a reply

Server time is: 2026-07-11 04:23:16
Your offset time is: 2026-07-11 04:23:16