Can you insert a Page Break in the Atmel Studio Editor?

Go To Last Post
17 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

I would like to print a listing of my program source code, which is about 10 pages long for a Code Review.

I will need to format the listing so the pages break at logical places and I can have one or two functions on a single page, etc.

Is there a Page Break character that Atmel Studio has for this kind of thing?

 

Obviously, I could always copy the listing to a different editor and insert the page breaks if Atmel Studio does not do this.

I could also insert blank lines to force breaks where I want them, but this is a pain to support. 

It would just be easier to do this in Atmel Studio and leave the Page Breaks in the program source. 

 

Thanks for your help,

Paul

You never know where life is going to take you; sit back and enjoy the ride!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't know of any IDE or programmer's editor that does this - it's really not what they're for.

 

You could try putting a FF (Form-Feed) character in a suitably-placed comment?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Paper based code review???

 

How 20th century!

 

 

Click Link: Get Free Stock: Retire early!

share.robinhood.com/jamesc3274

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In the past I've simply inserted as many line feeds as it takes to get a break onto the "next page". But I haven't really printed anything for 15+ years now so haven't really needed look for better ways. Like Andy I can't think of any recent IDE that offers this (that I've noticed anyway). What I'd probably do is use a code coloriser (several online sites offer this) then paste the result into Word then add the breaks there.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

PaulieT wrote:
print a listing of my program source ...  for a Code Review.

Trying so do a code review from a printout is very difficult - I've done that as an exercise in a classroom situation and was surprised at the many (deliberate) defects. I missed .

 

On the other hand  it could be worse; you could hand out punched cards for your code review.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I do occasionally find it useful to print out snippets of code. More that 1 page would be unusual.

 

What I do is  to select a suitable amount of the code, and then use the editor's 'Print Selection' feature.

I guess that should be doable for 10 pages ... ?

 


 

Another option:

 

Sometimes, when you copy code from a syntax-highlighting editor into Word, the syntax-highlighting gets into the Word doc - so you could then use Word to do the pagination ...

 

 

(other word processors are available - they may or may not behave similarly)

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
You could try putting a FF (Form-Feed) character in a suitably-placed comment?
Ada has a page pragma (command to compiler) to either insert the FF or as an instruction to other tools.

A guess is likewise by the C pre-processor.

Or, as Cliff has suggested, a C pretty printer.

 

https://en.wikibooks.org/wiki/Ada_Programming/Pragmas/Page

https://gcc.gnu.org/onlinedocs/gcc-4.8.5/gnat_ugn_unw/Other-Formatting-Options.html#Other-Formatting-Options

...

-ff

Insert a Form Feed character after a pragma Page. 

...

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yea ... seems to be web based now.

C-to-HTML then the reviewer can operate a web browser because some reviewers (ones in SQA, managers) don't have the IDE.

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's really bad when you drop the punch cards!

 

You never know where life is going to take you; sit back and enjoy the ride!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Thanks for all your suggestions.

 

Paul

You never know where life is going to take you; sit back and enjoy the ride!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

https://www.avrfreaks.net/forum/what-c-editor-use-novice#comment-2414626

...

But if you want "source browsing" which involves the concept of "projects" that collect together a bunch of C and H files then you really need an IDE (though "Source Insight" is brilliant, if a little expensive).

...

IIRC from a skim through part of the Source Insight operator's manual, there's coloring and definitely one mention of "pagination".

The page breaks are displayed, pages can be printed, and HTML can be generated from the source code.

 

Source Insight

Source Insight Programming Editor and Code Browser

https://www.sourceinsight.com/

https://s3-us-west-2.amazonaws.com/assets.sourceinsight.com/download/v4/doc/SourceInsight4UserGuide.pdf (11.5MB)

via https://www.sourceinsight.com/documentation/

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you want to impress your reviewers, then use Doxygen.

Doxygen can extract comment & code and genereate cross referenced and indexed HTML pages for documenting your code.

 

A trick I used long ago is to directly input a Form Feed character into the source code comment. (oops, already mentioned)

In the dos age his was easy. You could hold the ALT key and then type the ascii value of the character you wanted (12 in this case) on the numeric keypad.

 

awneil wrote:
I do occasionally find it useful to print out snippets of code. More that 1 page would be unusual.
For work I once had to find a bug in a badly written function. Lots of loops if / else and other stuff. (Written by somebody else of course). After staring at it for several hours I still got lost in the code and to get some overview of that single function I printed the whole thing on paper and glued the pages together (This was after the dot matrix age). It was 7 or 8 pages.

 

To Awneil: Do you have a multiple monitor setup? In this age & day it would be silly to work from a single monitor, unless you have a really big one (I still want a 34" 4k monitor for code writing & CAD design). Rotating the monitor also helps a lot. I have 2 24" monitors of a pretty common 1920x1200 resolution, which I can rotate at will. Usually Portrait on the left (for code & web sites) Landscape on the right for my logic analyser. (it's off at the moment). I write my code in Qt Creator and I can get 121 lines of easily readable text with this setup. Added a screenshot. It's only 1048 pixels wide so I still have easy accesisble other windows (file browrser, terminal)  next to it.

(Edit: AvrFreaks scales images, so for looking at readability you have to make sure it's 1:1)

Paul van der Hoeven.
Bunch of old projects with AVR's:
http://www.hoevendesign.com

Last Edited: Sun. Mar 11, 2018 - 09:24 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Paulvdh wrote:
For work I once had to find a bug in a badly written function. Lots of loops if / else and other stuff.

Yes, that's the kind of thing where I find paper, pencil, and highlighters help.

 

Do you have a multiple monitor setup?

Yes

 

 

In this age & day it would be silly to work from a single monitor

Agree.

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Code won't have heavily nested while / if / else if it's regularly checked for cyclomatic complexity (preferably on every push to master)

Last Edited: Sun. Mar 11, 2018 - 11:28 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

Paulvdh wrote:
Do you have a multiple monitor setup?

awneil wrote:
Yes

But now I want one of these:  https://www.youtube.com/watch?v=...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I, one who destroys hinges frown

Thanks though!

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, I think that's been the failure mechanism for most of my past laptops!

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...