Toon posts:

[VB.Net] Commentaar inklapbaar maken

Pagina: 1
Acties:
  • 153 views sinds 30-01-2008
  • Reageer

Verwijderd

Topicstarter
Een van de voordelen van met VS werken vind ik (naast IntelliSense) het feit dat functies e.d. "ingeklapt" kunnen worden.

Nu wil ik graag dat commentaar (zeker de regels met Pre, Post condities enzo) ingeklapt kunnen worden.
Ik heb echter op google niet kunnen vinden, "remarks" is een woord dat nogal veel gebruikt wordt.

Ik heb ooit eens een stuk code gedownload, en daar werke het wel, maar hoe het precies moet weet ik dus niet meer... :'(

[ Voor 18% gewijzigd door Verwijderd op 12-04-2005 11:20 ]


  • sig69
  • Registratie: Mei 2002
  • Laatst online: 08-05 21:15
Ik kan commentaar gewoon inklappen?

Anders kan je nog een region gebruiken:

#region Blaat

Code etc
.....

#endregion

Roomba E5 te koop


Verwijderd

Topicstarter
code:
1
'#region' and '#end region' statements are not valid within method bodies.

  • .oisyn
  • Registratie: September 2000
  • Laatst online: 04:30

.oisyn

Moderator Devschuur®

Demotivational Speaker

Over welke taal gaat het hier eigenlijk?
Anders kan je nog een region gebruiken:
Regions werken niet in alle .Net talen

En voor C++ kan ik mijn comments ook inklappen...

[ Voor 27% gewijzigd door .oisyn op 12-04-2005 11:27 ]

Give a man a game and he'll have fun for a day. Teach a man to make games and he'll never have fun again.


  • Riegstar
  • Registratie: Februari 2003
  • Niet online

Riegstar

Wadapatja!

code:
1
2
#region
#endregion

  • gorgi_19
  • Registratie: Mei 2002
  • Nu online

gorgi_19

Kruimeltjes zijn weer op :9

.oisyn schreef op dinsdag 12 april 2005 @ 11:26:
Over welke taal gaat het hier eigenlijk?


[...]

Regions werken alleen in C#
Ook VB.Net hoor :) Wellicht ook J#, maar daar heb ik het niet in kunnen uitproberen :)
Verwijderd schreef op dinsdag 12 april 2005 @ 11:25:
code:
1
'#region' and '#end region' statements are not valid within method bodies.
De foutmelding lijkt me duidelijk? :?

[ Voor 31% gewijzigd door gorgi_19 op 12-04-2005 11:27 ]

Digitaal onderwijsmateriaal, leermateriaal voor hbo


  • whoami
  • Registratie: December 2000
  • Laatst online: 01:02
/// commentaar kan je alleszins inklappen,
// en /* */ niet dacht ik

https://fgheysels.github.io/


  • .oisyn
  • Registratie: September 2000
  • Laatst online: 04:30

.oisyn

Moderator Devschuur®

Demotivational Speaker

whoami schreef op dinsdag 12 april 2005 @ 11:27:
/// commentaar kan je alleszins inklappen,
// en /* */ niet dacht ik
Ik kan in C++ al het commentaar inklappen wat meerdere regels beslaat, of dat nou met // of met /* */ gedaan wordt. Zelfs al gebruik je // met witregels ertussen.

[ Voor 8% gewijzigd door .oisyn op 12-04-2005 11:29 ]

Give a man a game and he'll have fun for a day. Teach a man to make games and he'll never have fun again.


Verwijderd

Topicstarter
Taal is vb.net.

Het commentaar staat aan het begin van een functie:
Visual Basic:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Public Function NavBar(ByVal StartPoint As String, ByVal Style As String, _
    Optional ByVal strCustomHead As String = "", Optional ByVal strCustomFooter As String = "", _
    Optional ByVal strCustomPre As String = "", Optional ByVal strCustomPost As String = "") As String
        ' PUBLIC FUNCTION
        ' AUTHOR:                               Jean-Paul Mars
        ' BUILDING DATE:                        11 APRIL 2005
        ' REMARKS:                              Recursive function, use with care.
        '
        ' GENERAL:                              This function builds a Navigation Bar, which tells 
        '                                       the user of the site what submenu's were used to reach 
        '                                       the current point.
        '                                       Also works when a user navigates directly to a specific 
        '                                       object.
        '                                       If an invalid StartPoint or Style is provided, an Error-
        '                                       Message is returned.
        '
        ' WRITE TO SCREEN:                      Never.
        '
        ' ARGUMENTS:            StartPoint      Tells the function what the current position so we know
        '                                       from where we need to 'walk' back to the root.
        '                       Style           Tells the function what style to use for the NavBar
        '                       * horizontal    The NavBar is built Horizontally
        '                       * verical       The NavBar is built Vertically
        '                       * custom        The NavBar is built based on options as described below
        '                       * INVALID       The Function returns an ErrorMessage
        '                       strCustomHead   Used if style is custom, otherwise ignored.
        '                                       Contains a string which is displayed before the NavBar
        '                       strCustomFooter Used if style is custom, otherwise ignored.
        '                                       Contains a string which is displayed after the NavBar
        '                       strCustomPre    Used if style is custom, otherwise ignored.
        '                                       Contains a string which is displayed before each item in 
        '                                       the(NavBar)
        '                       strCustomPost   Used if style is custom, otherwise ignored.
        '                                       Contains a string which is displayed after each item in
        '                                       the(NavBar)
        '
        ' RETURN VALUE:                         The entire NavBar (or ErrorMessage) is returned as a String
        '
        ' PRE-CONDITION:                        There is a valid ODBC connection to a database.
        '                                       (This is done when initializing this class.
        ' POST-CONDITION:                       The NavBar is returned as a string.

Het commentaar weglaten omdat het soms in de weg staat, vind ik ook niet zo'n goeie optie O-)

  • whoami
  • Registratie: December 2000
  • Laatst online: 01:02
.oisyn schreef op dinsdag 12 april 2005 @ 11:28:
[...]


Ik kan in C++ al het commentaar inklappen wat meerdere regels beslaat, of dat nou met // of met /* */ gedaan wordt. Zelfs al gebruik je // met witregels ertussen.
Nou, in C# kan ik dat blijkbaar niet.

Als ik zo het commentaar zie dat je wilt: kan je in VB.NET niet zoiets doen als in C# met het /// commentaar ?
Ik dacht dat er wel zo'n tooltje voor VB.NET bestond die dit mogelijk maakte.

[ Voor 24% gewijzigd door whoami op 12-04-2005 11:45 ]

https://fgheysels.github.io/


  • curry684
  • Registratie: Juni 2000
  • Laatst online: 07-05 22:49

curry684

left part of the evil twins

whoami schreef op dinsdag 12 april 2005 @ 11:44:
[...]

Nou, in C# kan ik dat blijkbaar niet.
Nee, maar dat komt omdat C# de strikte scheiding maakt tussen 'commentaar' met // en 'documentation' met ///. Commentaar is onderdeel van de code die eromheen staat, en dan zou het dus onzinning zijn om het in te kunnen klappen. Documentatie daarentegen heb je tijdens het coden zelf niet continu nodig, en die is dus wel inklapbaar. Omdat C++ dit onderscheid niet kent hebben ze het daar waarschijnlijk allemaal inklapbaar gemaakt. In C# kun je overigens met /** en */ ook multiline documentatie aangeven.

Professionele website nodig?


  • teun-v
  • Registratie: Maart 2005
  • Niet online

teun-v

Koffie? ja graag...

Bij mij is het in visual studio 2003 met vb.net mogelijk om comentaar in te klappen mits deze buiten een functie of procedure staat dus:

Visual Basic:
1
2
3
4
5
6
7
8
       ' HIER WEL INKLAPBAAR (ingeklapt blijft de eerste regelsaan)
       ' en is aleen inklapbaar met meer regels komentaar

Public Function NavBar(ByVal StartPoint As String, ByVal Style As String, _ 
    Optional ByVal strCustomHead As String = "", Optional ByVal strCustomFooter As String = "", _ 
    Optional ByVal strCustomPre As String = "", Optional ByVal strCustomPost As String = "") As String 

        ' CODE NIET INKLAPBAAR

Ook gek op Ovalracen? | Canon EOS 350 D | Canon EF-S 10-22mm F/3.5-4.5 | Sigma 17-70 F/2.8-4.5 DC Macro | Canon EF 70-200 F/2.8L USM | >Blog< |


  • gorgi_19
  • Registratie: Mei 2002
  • Nu online

gorgi_19

Kruimeltjes zijn weer op :9

curry684 schreef op dinsdag 12 april 2005 @ 11:49:
[...]

Nee, maar dat komt omdat C# de strikte scheiding maakt tussen 'commentaar' met // en 'documentation' met ///. Commentaar is onderdeel van de code die eromheen staat, en dan zou het dus onzinning zijn om het in te kunnen klappen. Documentatie daarentegen heb je tijdens het coden zelf niet continu nodig, en die is dus wel inklapbaar. Omdat C++ dit onderscheid niet kent hebben ze het daar waarschijnlijk allemaal inklapbaar gemaakt. In C# kun je overigens met /** en */ ook multiline documentatie aangeven.
VB.Net kan dat ook, mits je de VBCommenter plugin voor VS.Net gebruikt :)

Digitaal onderwijsmateriaal, leermateriaal voor hbo


Verwijderd

Topicstarter
gorgi_19 schreef op dinsdag 12 april 2005 @ 12:13:
[...]

VB.Net kan dat ook, mits je de VBCommenter plugin voor VS.Net gebruikt :)
Prachtig tooltje, trouwens :9~
Pagina: 1