Sections in Classes?
5 posts
• Page 1 of 1
Sections in Classes?
When editing a class, the tree-view in the left pane has a "Sections"-entry, but I could not find any explanation on how to create sections in the PDFs, and somehow I could not figure it out from menues etc. either, so I'd be happy if someone could comment on that...
-
MBaas - Posts: 156
- Joined: Thu Oct 16, 2008 1:17 am
- Location: Gründau / Germany
Re: Sections in Classes?
We'll fix that omission !
However, a very brief summary follows:
A section is merely a control structure which allows you to group a block of lines together .. so that for example you can collapse them.
Since it is a control structure the rules regarding nesting with other control structures or functions hold.
If you want to define a section, then you have to have to type the ":section" and ":endsection" yourself.
So if I'm in the editor I see:
and given that I don't want to see the boring section, I can toggle the outline and I get:
(I've done this on a tty version but the same applies equally to a Windows version)
However, a very brief summary follows:
A section is merely a control structure which allows you to group a block of lines together .. so that for example you can collapse them.
Since it is a control structure the rules regarding nesting with other control structures or functions hold.
If you want to define a section, then you have to have to type the ":section" and ":endsection" yourself.
So if I'm in the editor I see:
- Code: Select all
[0] foo
[1] ⍝ this is an interesting line
[2] ├:section boring
[3] │Flatten←{⎕ml←3 ⋄ ⍷⍵}
[4] │⍝ loads of boring stuff which I'm not really
[5] │⍝ very interested in when tracing
[6] ├:endsection
[7] ⍝ this gets interesting again
[8] andy←1
[9]
and given that I don't want to see the boring section, I can toggle the outline and I get:
- Code: Select all
[0] foo
[1] ⍝ this is an interesting line
[2] ┼:section boring
[7] ⍝ this gets interesting again
[8] andy←1
[9]
(I've done this on a tty version but the same applies equally to a Windows version)
-
AndyS|Dyalog - Posts: 263
- Joined: Tue May 12, 2009 6:06 pm
Re: Sections in Classes?
Cool, thanks. I assume that works only within fns, but not within classes, so that one could put several boring fns into a separate section? I think something like that (or perhaps user-defined jump-points (or 'labels' within the class) which would also be accessible for navigation in the tree-view could be interesting ;-)
-
MBaas - Posts: 156
- Joined: Thu Oct 16, 2008 1:17 am
- Location: Gründau / Germany
Re: Sections in Classes?
Bug-Report:
Ok, a section can also contain several functions BUT all functions defined in a section disappear from the "Methods"-branch of the treeview!
Ok, a section can also contain several functions BUT all functions defined in a section disappear from the "Methods"-branch of the treeview!
-
MBaas - Posts: 156
- Joined: Thu Oct 16, 2008 1:17 am
- Location: Gründau / Germany
5 posts
• Page 1 of 1
Return to Object Oriented Programming
Who is online
Users browsing this forum: No registered users and 0 guests
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group