Folding

Started by John Montenigro, December 12, 2009, 04:55:51 PM

Previous topic - Next topic

John Montenigro

I'm just getting used to Folding, and it's growing on me, so now I have a question/request for enhancement.

When I write a SUB or FUNCTION, I write one or two lines of comments to briefly describe its purpose or special aspects about it or its parameters...

I was wondering if it might be possible to provide an Option somewhere (global, plus per module override?) so that when I collapse a routine, any contiguous non-blank comment lines that follow the SUB or FUNCTION definition line would be displayed?

FUNCTION AddTwo (byval GivenValue as long) as long
'This routine just adds the constant 2 to its param and returns the result.

'Check that GivenValue is within acceptable range:
CALL CheckGivenValue (GivenValue)

FUNCTION = GivenValue + 2
END FUNCTION


Would look like:
FUNCTION AddTwo (byval GivenValue as long) as long
'This routine just adds the constant 2 to its param and returns the result.
END FUNCTION


I wasn't involved during testing of FF3, but I gather that Folding was pretty complex; so I don't know if this idea could be implemented...

Such a feature would help me when printing the code in my modules; in this "Overview' mode, it would look like a spec.


Roger Garstang

Put the comments before the Function line like Visual Studio does.  Now, enhancing this to allow for some type of XML or something to describe the function and its parameters and enhance the Function Tooltips would be cool though.

John Montenigro

QuotePut the comments before the Function line

Doh! makes total sense! 

I see I was speaking from my old habit of "containing" my comments to go in the routine (in case I ever copy it), rather than putting comments "ahead" of the routine, where I usually put notes to myself while coding... 

So, OK, I suppose we can drop the idea to the bottom of the list!

-John

(I'm not familiar with Visual Studio...)


Roger Garstang

I was the same way when I went back to PB and Visual Studio after 4 years of College in C/C++ where they go within the function.  Professors even took off points if every function didn't have the IPO headers the first year then even further detail when we went more OO.  Having FF make use of certain comments would be a plus though, so I don't think it should be shoved all the way to the bottom...maybe just shuffled in the middle.