Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Block comment key short cut
Block comment key short cut [message #31581] Wed, 16 March 2011 13:10 Go to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
I just discovered that I could jump to a #incluide file by CTRL+ LEFT MOUSE CLICK on the #include file name.

So I figure that as a most commonly used function, block comment may as well have being implemented. If it's true, how?

And please share some other little tricks with the IDE that may help to save time and increase productivity.

Thank you for your tips.
Re: Block comment key short cut [message #31582 is a reply to message #31581] Wed, 16 March 2011 13:26 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Lance wrote on Wed, 16 March 2011 13:10

I just discovered that I could jump to a #incluide file by CTRL+ LEFT MOUSE CLICK on the #include file name.

So I figure that as a most commonly used function, block comment may as well have being implemented. If it's true, how?

And please share some other little tricks with the IDE that may help to save time and increase productivity.

Thank you for your tips.

Hi Lance,

To jump to included file (and many other useful locations, like function or variable declaration) you can also use Alt+j shortcut for context jump. It will jump to location associated with word under cursor. Also Alt+Left arrow/Right Arrow allow you to browse back and forth through the history, so you can easily get back where you were before the context jump.

I am not sure what you mean by block comment function, but you might like to turn on the option "/*( enloses selection" (or something like that, I don't have theide here right now Smile ) in Setup -> Environment. If you then select block of text pressing * or / will comment it out. Similar behavior works also for brackets and some other keys maybe (sorry, speaking from top of my mind here Smile ).

Best regards,
Honza

PS: You should check the key shortcuts setting dialog, it could give you some ideas about what tricks are hidden in the ide Wink

[Updated on: Wed, 16 March 2011 13:29]

Report message to a moderator

Re: Block comment key short cut [message #31584 is a reply to message #31582] Wed, 16 March 2011 14:01 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
Thank you very much for your quick response!

By block comment, I mean select a block of code, press some key shortcut or a tool button, voila, all the lines have a pretty
//
preceding them. And you can also BLOCK uncomment selected code lines so that those line are back to life again(preceding first 2 // removed)

The way you mentioned may be functionally equivalent or similar, but it doesn't allow nested actions, eg, you may comment 3 lines and subsequently want to comment a larger block containing these 3 lines. Majority of C++ preprocessors don't accept nested /**/ comment, at least by default.


Re: Block comment key short cut [message #31585 is a reply to message #31584] Wed, 16 March 2011 14:04 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
I find another shortcut:
When browsing code, you can CTRL + Mouse LEFT CLICK a function to navigate to its declaration etc. It's very handy when you are trying to dig into the U++ library code.
Re: Block comment key short cut [message #31604 is a reply to message #31584] Thu, 17 March 2011 03:29 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
Lance wrote on Wed, 16 March 2011 09:01

Thank you very much for your quick response!

By block comment, I mean select a block of code, press some key shortcut or a tool button, voila, all the lines have a pretty
//
preceding them. And you can also BLOCK uncomment selected code lines so that those line are back to life again(preceding first 2 // removed)

The way you mentioned may be functionally equivalent or similar, but it doesn't allow nested actions, eg, you may comment 3 lines and subsequently want to comment a larger block containing these 3 lines. Majority of C++ preprocessors don't accept nested /**/ comment, at least by default.





Setup -> Environment -> Assist
Check "[ { ( " / * enclose selection"
Select a block of lines.
Press /
Smile


Regards,
Novo
Re: Block comment key short cut [message #31605 is a reply to message #31604] Thu, 17 March 2011 07:17 Go to previous messageGo to next message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

Wow, that was a big help to me as well. Thanks Novo.
Re: Block comment key short cut [message #31617 is a reply to message #31605] Thu, 17 March 2011 18:53 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
Thanks Novo, That's exactly what I wanted.
Re: Block comment key short cut [message #31618 is a reply to message #31617] Thu, 17 March 2011 23:27 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
Works good.

Maybe someday there will be a Manual that can be downloaded that includes tips like this.

There are capabilities that Upp has that could be very useful if we knew what they are.

Neil

[Updated on: Sat, 19 March 2011 05:30]

Report message to a moderator

Re: Block comment key short cut [message #31625 is a reply to message #31604] Fri, 18 March 2011 10:38 Go to previous messageGo to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hi,

Novo wrote on Thu, 17 March 2011 03:29

Setup -> Environment -> Assist
Check "[ { ( " / * enclose selection"
Select a block of lines.
Press /
Smile

... And after, reselect the same block of lines, press / again and you will undo what you did Wink

This is why I like very much Upp : There are a lot of very practical (and Funky!) tips Smile

The only thing missing is good documentation ! Well : I know and I understand why : days are only 24 hours... What exists now is already good, and I think that paying attention to small details like the one I suggested here, could greatly improve it. I think the problem of documentation is that it is too difficult to find what we need, not so often that it's missing.

Anyway, thanks and congratulations to Upp developpers !
Re: Block comment key short cut [message #31664 is a reply to message #31625] Sat, 19 March 2011 03:04 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
I owe dolik.rce a big thank-you. He actually gave me the right answer but I missed the point.
Re: Block comment key short cut [message #31672 is a reply to message #31664] Sat, 19 March 2011 11:43 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Lance wrote on Sat, 19 March 2011 03:04

I owe dolik.rce a big thank-you. He actually gave me the right answer but I missed the point.

No problem Smile In a community assembled from people all over the world, such things just happen easily Wink I already got used to it...

Honza
Re: Block comment key short cut [message #33111 is a reply to message #31581] Thu, 07 July 2011 10:58 Go to previous messageGo to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hi,

I'm almost sure that I saw a way to prepare functions like this :
myfunction {

}

and put the cursor at the right place to write the function (1st line with indentation), but I'm unable to retrieve it... could somebody remind us about that here, so it will complete this post Wink

And more generally, maybe there is a way, when you type something working by pair like {([, to have immediatly the pair and cursor inside ?

Thks.

[Updated on: Thu, 07 July 2011 10:59]

Report message to a moderator

Re: Block comment key short cut [message #33112 is a reply to message #31581] Thu, 07 July 2011 11:24 Go to previous messageGo to next message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

Nice question. Set me seeking too. Can't believe it's so easy

Look for the abbreviations under Setup menu item.

To create a While loop, just type w followed by Ctrl+[.] (under assist-> complete abbreviation) and you will get your while structure ready to use.
Re: Block comment key short cut [message #33114 is a reply to message #33112] Thu, 07 July 2011 16:24 Go to previous message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
jerson wrote on Thu, 07 July 2011 11:24

Look for the abbreviations under Setup menu item.

Embarassed Yes, it's what I was looking for... Probably making some mistake, as for functions it will not be so easy.
I looked for that in the forum and in the help and was unable to find. Just forgot to look at the Setup menu !

I'm almost sure that I saw that somewhere else in the forum, but cannot find it anymore...

Something strange : I cannot edit or delete any item, the buttons are grayed ! But it's possible to use the popup menu that appears when right-clicking on a keyword...

For functions, I added the v keyword, doing this :
void @()
{
	
}


I also added p :
( @ ) 


Thank you, jerson ! Smile

BTW : CTRL+[.] works only with the point of the numeric pad...

[Updated on: Thu, 07 July 2011 16:28]

Report message to a moderator

Previous Topic: Foreign Languages - For FileSel, PromptOK, and other
Next Topic: Looking for an idea to hide cursor in SqlArray
Goto Forum:
  


Current Time: Fri Mar 29 03:32:22 CET 2024

Total time taken to generate the page: 0.01452 seconds