Page 1 of 1

IDE: Quick jump to Macro and Label "declaration" as well

Posted: Sat Jan 08, 2011 5:07 pm
by c4s
When the procedure name has focus and we press Ctrl + double-click on left mouse button, the selector will jump to the procedure declaration (or whatever it is called) which is quite handy.

Now I thought that it might be pretty good when it could do the same for labels and macros:

Code: Select all

Procedure TestProcedure()
EndProcedure

Macro TestMacro()
EndMacro

Label:


TestProcedure()  ; Focus and Ctrl + left double-click -> jumps to line 1

TestMacro()  ; -> should jump to line 4

Goto Label  ; -> should jump to line 7

Re: IDE: Quick jump to Macro and Label "declaration" as well

Posted: Sun Oct 11, 2015 1:06 pm
by c4s
I'm extending this request to really everything... So not just procedures, macros or labels, but also variables, structures, constants etc. After all the IDE should know where exactly something was defined, right?! (Obviously certain macro tricks can cause problems but the IDE is rightfully ignoring them anyway.)

Re: IDE: Quick jump to Macro and Label "declaration" as well

Posted: Sun Oct 11, 2015 2:06 pm
by GPI
[quote="c4s"]When the procedure name has focus and we press Ctrl + double-click on left mouse button, the selector will jump to the procedure declaration (or whatever it is called) which is quite handy.

Now I thought that it might be pretty good when it could do the same for labels and macros:


I don't think that a declaration of a Macro makes any sense and I think, you don't understand, what a macro is

in your Example:

Code: Select all

TestMacro()  ; -> should jump to line 4
is complete wrong.
A Macro work like search and replace. Search in the Quellcode "TestMacro()" and replace it with the Text between Macro and EndMacro. There is no jump. And thats why a declaration doesn't make sence.

About Labels: You don't need to declare labels, even when they used before the definition. Labels are only a Adress and with "?label" the compiler has every information which he need in there. Also in your Example: Goto will work! But important: You can't goto or gosub outside or inside a procedure! And in 99,99% of all cases: DON'T USE GOTO AND GOSUB! Use Procedures instead.

Re: IDE: Quick jump to Macro and Label "declaration" as well

Posted: Sun Oct 11, 2015 3:13 pm
by c4s
@GPI
Sorry, but you really didn't understand what I mean. Maybe I've mixed-up the words "declaration" and "definition", but if you know the feature I'm talking about in the example you should know what I've actually meant.

So let me put it this way: Double-click on a procedure's name, while the [Ctrl] key is pressed, jumps to the definition of the procedure. I think we all agree that this is a cool feature, right? I simply want it to be expanded on macros, structures etc. as well. (Granted that it makes less sense for variables or labels but why not implement it for them too for the sake of completeness?)
GPI wrote:in your Example:

Code: Select all

TestMacro()  ; -> should jump to line 4
is complete wrong.
My example is correct, trust me: [Ctrl] key plus double-click on "TestMacro" should jump to line 4 of the IDE's source code file (not during runtime :shock: ).

Re: IDE: Quick jump to Macro and Label "declaration" as well

Posted: Sun Oct 11, 2015 3:43 pm
by GPI
Sorry, i missunderstod you. I thougt that you want to "declare" a Macro, so you can use it bevor you define the macro. You want the IDE, that on a doubleclick on Macro/Label it should set the cursor to the definition of the Label/macro.

Re: IDE: Quick jump to Macro and Label "declaration" as well

Posted: Sun Oct 11, 2015 4:06 pm
by c4s
GPI wrote:Sorry, i missunderstod you.
No problem.
GPI wrote:I thougt that you want to "declare" a Macro, so you can use it bevor you define the macro.
Well, actually I've requested that in another thread. Unfortunately it seems like macros are too wayward for that. But I still think that "declare" for arrays, lists, variables or structures makes sense, because in the end I want to structure my code the way I want and not how the compiler needs it.
GPI wrote:You want the IDE, that on a doubleclick on Macro/Label it should set the cursor to the definition of the Label/macro.
Yes, that's correct.

Re: IDE: Quick jump to Macro and Label "declaration" as well

Posted: Sun Oct 11, 2015 7:29 pm
by davido
GPI wrote: But I still think that "declare" for arrays, lists, variables or structures makes sense, because in the end I want to structure my code the way I want and not how the compiler needs it.
+1

@GPI,
I've always wondered why the IDE cannot automatically place a declare list for us near the head of the code. It already does something similar on the 'Procedures' Panel?
Perhaps I'm missing the obvious. :)

Re: IDE: Quick jump to Macro and Label "declaration" as well

Posted: Tue Oct 13, 2015 4:07 pm
by HanPBF
Very great idea upgrading the IDE!

+2 voting points from my 10 a week :wink:

Re: IDE: Quick jump to Macro and Label "declaration" as well

Posted: Sat Jun 01, 2024 2:22 am
by BarryG
+1 for macros. The procedure browser lets us jump directly to macros, so the functionality is there, meaning Ctrl+DoubleClick could do it for them, too.