Jump to Next/Previous Function Definition

I prefer to browse my code manually rather than using MSVC's Wizard Bar. These simple macros move the cursor up and down one function at a time in a cpp file. This is accomplished by searching for a newline character followed by an open brace ('{'). Simple as they may be, they help me get the cursor where I want it quickly and easily. I map these functions to Ctrl-Page Up and Ctrl-Page Down.

Note: They do not work with functions that have the open brace on the function definition line.


Sub GotoFunctionHeaderUp()
'DESCRIPTION: Moves cursor to the previous function definition.
	ActiveDocument.Selection.FindText "^{", dsMatchBackward + dsMatchRegExp
	ActiveDocument.Selection.LineUp
	ActiveDocument.Selection.StartOfLine
End Sub

Sub GotoFunctionHeaderDown()
'DESCRIPTION: Moves cursor to the previous function definition.
	ActiveDocument.Selection.LineDown dsMove, 2
	ActiveDocument.Selection.FindText "^{", dsMatchRegExp
	ActiveDocument.Selection.LineUp
	ActiveDocument.Selection.StartOfLine
End Sub

Josi Manuel Muilledes suggests using DevStudio commands WBGotoNext and WBGotoPrevious from WizardBar category.

Updated on: October 15, 1998.



Comments

  • Why the turf’s most shit actions gears athletes alternative eats headphone

    Posted by motherdhmm on 06/04/2013 04:18pm

    [url=http://www.headphonescheaponlineaustralia.com/]beats by dre Australia[/url] Heinousness headphones in Australia more and more in fashion, more people use thebeats close to Dre, a play up that was seen via some lawbreakers topic opportunities, ergo, followed not later than pronouncement of hoax and chintzy scare off products and markets, to manyconsumers in trouble, to shell out a portion of shin-plasters to corrupt is not trustworthy beats beside dre beats away Dre. Again, if you¡¯re reading this, then you are charmed, the sympathy that the next wish be to introduce, buy authentic beats via dre should be noted that the empathy of these later in the acquiring of a monster headphones you can steal legitimate the. [url=http://blog.cheapbeatsbydre.co.nz/beats-by-dre-headphones]beats by dre headphones[/url] You may also like this Horribleness Turbine Earphones, With a view the callow users, hipop fans and NBA fans, the outward mien is also of the standards in support of a Ghoulishness Beats Dr Dre, and even-tempered a central standard. As a recent emerging in operation in headphone industry, Hideousness products song equal distress on both publication and acoustic. It is not a untypical thing to accede to that Monster Beats Studiobecomes the favourite choice repayment for lots of stars. [url=http://blog.cheapbeatsbydre.co.nz/]beats by dre[/url] These Beats Headphones emit great good efficiency that any at one, from the for the most part joe, to your kinfe like audiophile can certainly value. It includes crystal readable, distortions manumitted rival, calm with high in bulk levels. Dre is currently out there. Any individual searching seeking a credible quality enumerate of beers is effectively supported unmistakeably via most of these earphones. Contribution an staggering array as extravagantly as eminence of submerge, Defeats close to totally Beats by Dr Dre would be the Wireless Bluetooth headphones you give birth to been holding exposed regarding. Drink them all night without the require of distressing with regards to battery or comfort and ease. Put together effortlessly in between phone calls as ok as playing as a consequence of your built-inside microphone along with headphone adjustments.

    Reply
  • Sigue tu mujer feliz con planchas GHD!

    Posted by hanmeihm on 05/30/2013 06:17pm

    [url=http://www.planchasghdbaratasonline.com/]ghd España[/url] Entonces, qu sigue para GHD Bueno, se ha anunciado que GHD se lanzar¢ otra nueva styler del pelo que van a estar llamando la GHD Rare. La plancha de pelo GHD Rare viene con un acabado negro brillante ser¢ el oro teido placas de cer¢mica. Esto ayuda a que este nuevo Styler se destacan en su lugar concurrido mercado. Adem¢s, como el nuevo negro brillante styler, tambin hay un leopardo de impresin especial estuche y styler bolsa. Todo Comprar GHD Gold ghd Planchas productos se entregan de forma gratuita dentro de Espaa. El envo internacional se realiza a travs del Servicio Internacional Express. Los pedidos se envan normalmente dentro de las 48 horas a partir de la fecha del pedido. [url=http://www.planchasespanaghdtop.net/plancha-pelo-ghd/]ghd outlet[/url] Planchas ghd pelo tena una etiqueta de precio fuerte, mucho ms para que estos alisadores de pelo milagro. Los crculos de famosos y la belleza no poda alabar a este nuevo producto bastante asombroso. reparaciones ghd planchas fue la debe tener. Volver peinar su cabellera es verdaderamente una aclimatacin rpida y sin esfuerzo que le permite a uno llevar a cabo un corte de pelo admirable en ningn momento, as como incluso se puede administrar lo que debera de entrada que una cola de caballo e incluso un moo. [url=http://www.planchasespanaghdtop.net/plancha-pelo-ghd/]baratas ghd outlet[/url] cuando GHD anuncia pequea revolucin que trabaja en una sola vez en el cabello grueso y crespo, lo dice a m.

    Reply
  • Thanks

    Posted by jackaliger on 04/15/2007 09:32am

    Thanks

    Reply
  • ThanX~~~

    Posted by Legacy on 04/15/2002 12:00am

    Originally posted by: tomcruse

    nice~~~ ThanX~~~

    Reply
  • Thank you! Nice work!

    Posted by Legacy on 12/05/2001 12:00am

    Originally posted by: B P

    Thank you for this neat and useful macro.

    Reply
  • Good work, i was sooo looking for something like this to help with what i am doing

    Posted by Legacy on 10/18/2000 12:00am

    Originally posted by: Jimbo

    Can u plz tell me what command i can use to strore the current procedure name as a string....
    if i use that function to get to the start of it, how do i then "select" that line?
    (i wanna read in all the parameters of a function, so i can determine if they are inputs or outputs, and then generate a function header, to save me making a comment header my self for every function)
    thank you.
    -Jim

    Reply
  • Great macros

    Posted by Legacy on 09/20/2000 12:00am

    Originally posted by: Peter W. Binsted

    Thank you very much! These work great, I've been trying to get these forever :)

    Reply
  • I like it

    Posted by Legacy on 08/10/2000 12:00am

    Originally posted by: Jorge L. Diez

    How do I make the start of function the top line.

    Reply
  • comment on comment from Jos� Manuel Mu�lledes

    Posted by Legacy on 10/15/1998 12:00am

    Originally posted by: Gert Rijs

    The WBGotoNext/Previous commands only work in a file from the
    active project (annoying if you have several projects in one workspace).
    Keith's macro's will work with any open cpp file.

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • On-demand Event Event Date: September 10, 2014 Modern mobile applications connect systems-of-engagement (mobile apps) with systems-of-record (traditional IT) to deliver new and innovative business value. But the lifecycle for development of mobile apps is also new and different. Emerging trends in mobile development call for faster delivery of incremental features, coupled with feedback from the users of the app "in the wild." This loop of continuous delivery and continuous feedback is how the best mobile …

  • Stories about devastating cyberattacks are plaguing the news. Why? The DNS protocol is easy to exploit. See your network the way hackers do—as an easy target. Learn how you can effectively secure your DNS infrastructure today.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds