[Tip] Procedure "index" at the top of your source

Share your advanced PureBasic knowledge/code with the community.
HanPBF
Enthusiast
Enthusiast
Posts: 563
Joined: Fri Feb 19, 2010 3:42 am

Re: [Tip] Procedure "index" at the top of your source

Post by HanPBF »

-
Last edited by HanPBF on Sat Dec 29, 2018 8:18 pm, edited 1 time in total.
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: [Tip] Procedure "index" at the top of your source

Post by Marc56us »

skywalk wrote:How do you get the Issue Browser as a floating window? :shock:
Remove it from tools panel and open it from tools menu.

:wink:
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [Tip] Procedure "index" at the top of your source

Post by skywalk »

I get it now. If you put Issues in the tools panel, floating window is not possible. :idea:
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: [Tip] Procedure "index" at the top of your source

Post by Marc56us »

Yes PB IDE tools can be opened via tools panel OR by tools menu but not both together

:wink:
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: [Tip] Procedure "index" at the top of your source

Post by Dude »

Bisonte wrote:Not really true.
I meant for blocks of code where you haven't used the ";-" comment style. In that case, it is true.
skywalk wrote:still a lot of dead typing.
I don't retype all my procedure names there; only the ones I use often. ;)

At the end of the day, when you have over 200 procedures and need to jump to a favorite one quickly, you simply can't beat this tip because there's no scrolling needed. That's what people here seem to keep overlooking. :shock:

Anyway, it works for me. Just thought it may be useful for others who also don't like scrolling through pages and pages of lists.
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [Tip] Procedure "index" at the top of your source

Post by skywalk »

Yes, but I'm saying you can achieve the same with ;-! MyFavProcedure, immediately after the procedure. I select the procedure, hit [ctrl+d], then arrow left to insert ;-! and done.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: [Tip] Procedure "index" at the top of your source

Post by Dude »

Skywalk, I don't understand. Say you've got 200 procedures and you want to instantly jump to procedure number 100, which might start at line 5000 of a 10000-line source. Assume your cursor is at line 7500.

With my tip, I literally hit Ctrl+Home then Ctrl+DoubleClick the procedure name, and bang, I'm at line 5000 in one second with no scrolling. The speed of source navigation this way cannot be understated.

How would I jump to line 5000 that quickly using your tip, if the cursor is currently on line 7500, and with no scrolling?
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [Tip] Procedure "index" at the top of your source

Post by skywalk »

I'm relying on the Procedure Browser to do the jump for me.
I do not mark all my Procedures with the suffix ";-!" . Only critical ones or those I am debugging.

Try it and see.
I even further document my program's flow with:
;-!1 MyStep()
;-!2 MyStep2()
;-!3 MyStep3()
These appear in order in the Procedure Browser.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: [Tip] Procedure "index" at the top of your source

Post by Dude »

I can't get it to work, Skywalk. :( Can you show a tiny snippet of what you're doing?

Also, I don't sort the Procedure Browser alphabetically as I prefer to see it the way the source actually is. Does that mean your method won't work?
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [Tip] Procedure "index" at the top of your source

Post by skywalk »

Ah, I thought you might have missed that requirement I mentioned.
Naming conventions help and I add a ";-!" suffix to important areas of code.
These appear at the top of the Procedure Browser and in alphabetic order if selected in preferences.
I cannot make sense of my Procedure Browser without alphabetic order. :?
This is incredibly helpful, when you couple naming conventions with your Macros/Procedures.
I arrange the order of my Procedures to eliminate Declares, which I maybe have 2 in 100k lines of code.
Here is an example applied as a TODO list.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: [Tip] Procedure "index" at the top of your source

Post by Dude »

Okay, thanks for clarifying. :)
User avatar
Olliv
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Sep 22, 2009 10:41 pm

Re: [Tip] Procedure "index" at the top of your source

Post by Olliv »

A small remark : choose the right procedure name.

ClassnameActSomeone()
ClassnameDoSomething()
etc...

GeneralModifyLocal()

i.e. :

ScreenGetWidth() what it could be read as a chapter title :

Screen : get the width

In this case, all the 200 procedures can be read on the panel. All is also alphabetical.

A second tip : export a class to an external source file.
In the way where a class seems to be rarely modified, there is no need to keep it in the main file.

Just keep two, three or fours classes in the main file.

Imagine you add Fred source code procedures (drawtext i.e.) : what would be the goal ?

A procedure you create, once created could be modified, but does not require to be read and controlled, again and again.

That was my remarks. But I appreciate such a dialog where a new idea is shared : I discover new (or less new) IDE options which cause new availabilities. Sure this tip has a place anywhere.

I think several preprocessing tools do not exist and the automatical access should be recalled to exchange several preprocess technics.
Post Reply