Programmatically read code in the IDE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tim Zych

    Programmatically read code in the IDE

    I would like a way to scan the code in a vb.net project, say by creating a
    vb.net utility to cycle through each line of code related to a particular
    project and perform some analysis on it.

    How do I program into the IDE? Did I ask that right? I need a way to
    programmaticall y cycle through each line of code, for any code that's
    related to a project.

    thanks for any pointers.


  • punjab_tom

    #2
    Re: Programmaticall y read code in the IDE

    I'd do it outside of the IDE?

    how much code are you talking about?





    On Feb 15, 9:32 am, "Tim Zych" <FirstInitial
    +LastName@earth _LinkDotNetwrot e:
    I would like a way to scan the code in a vb.net project, say by creating a
    vb.net utility to cycle through each line of code related to a particular
    project and perform some analysis on it.
    >
    How do I program into the IDE? Did I ask that right? I need a way to
    programmaticall y cycle through each line of code, for any code that's
    related to a project.
    >
    thanks for any pointers.

    Comment

    • RobinS

      #3
      Re: Programmaticall y read code in the IDE

      I would recommend that you write a program in VB that lets you specify a
      top folder (like where the solution is), and then it cycles through from
      that folder down looking for programs with a file extension of vb. Just
      read them as if they were text files and look at the code that way.

      Robin S.
      --------------------------
      "Tim Zych" <FirstInitial+L astName@earth_L inkDotNetwrote in message
      news:eF0gmbSUHH A.4796@TK2MSFTN GP05.phx.gbl...
      >I would like a way to scan the code in a vb.net project, say by creating a
      >vb.net utility to cycle through each line of code related to a particular
      >project and perform some analysis on it.
      >
      How do I program into the IDE? Did I ask that right? I need a way to
      programmaticall y cycle through each line of code, for any code that's
      related to a project.
      >
      thanks for any pointers.
      >
      >

      Comment

      • Lloyd Sheen

        #4
        Re: Programmaticall y read code in the IDE

        I tend to agree with what was said but with some reservations.

        I see more solutions with multiple folders (ie one for classes, one for
        forms , one for usercontrols etc.) If you read the .vbproj file you will
        find "Compile" nodes. Those are the source files you want. You will need to
        get the "Include" node which holds the file name and the relative position
        of the file.

        This should give you a start.

        Lloyd Sheen
        "RobinS" <RobinS@NoSpam. yah.nonewrote in message
        news:z7ednaqDuL Tkb0nYnZ2dnUVZ_ oupnZ2d@comcast .com...
        >I would recommend that you write a program in VB that lets you specify a
        >top folder (like where the solution is), and then it cycles through from
        >that folder down looking for programs with a file extension of vb. Just
        >read them as if they were text files and look at the code that way.
        >
        Robin S.
        --------------------------
        "Tim Zych" <FirstInitial+L astName@earth_L inkDotNetwrote in message
        news:eF0gmbSUHH A.4796@TK2MSFTN GP05.phx.gbl...
        >>I would like a way to scan the code in a vb.net project, say by creating a
        >>vb.net utility to cycle through each line of code related to a particular
        >>project and perform some analysis on it.
        >>
        >How do I program into the IDE? Did I ask that right? I need a way to
        >programmatical ly cycle through each line of code, for any code that's
        >related to a project.
        >>
        >thanks for any pointers.
        >>
        >>
        >
        >

        Comment

        • Tim Zych

          #5
          Re: Programmaticall y read code in the IDE

          Thanks...that looks very promising.

          "Lloyd Sheen" <a@b.cwrote in message
          news:161C9AE6-0CE3-4A86-BDD0-E40E488871A2@mi crosoft.com...
          >I tend to agree with what was said but with some reservations.
          >
          I see more solutions with multiple folders (ie one for classes, one for
          forms , one for usercontrols etc.) If you read the .vbproj file you will
          find "Compile" nodes. Those are the source files you want. You will need
          to get the "Include" node which holds the file name and the relative
          position of the file.
          >
          This should give you a start.
          >
          Lloyd Sheen
          "RobinS" <RobinS@NoSpam. yah.nonewrote in message
          news:z7ednaqDuL Tkb0nYnZ2dnUVZ_ oupnZ2d@comcast .com...
          >>I would recommend that you write a program in VB that lets you specify a
          >>top folder (like where the solution is), and then it cycles through from
          >>that folder down looking for programs with a file extension of vb. Just
          >>read them as if they were text files and look at the code that way.
          >>
          >Robin S.
          >--------------------------
          >"Tim Zych" <FirstInitial+L astName@earth_L inkDotNetwrote in message
          >news:eF0gmbSUH HA.4796@TK2MSFT NGP05.phx.gbl.. .
          >>>I would like a way to scan the code in a vb.net project, say by creating
          >>>a vb.net utility to cycle through each line of code related to a
          >>>particular project and perform some analysis on it.
          >>>
          >>How do I program into the IDE? Did I ask that right? I need a way to
          >>programmatica lly cycle through each line of code, for any code that's
          >>related to a project.
          >>>
          >>thanks for any pointers.
          >>>
          >>>
          >>
          >>
          >

          Comment

          • Tim Zych

            #6
            Re: Programmaticall y read code in the IDE

            That's nice "out of the box" thinking. When I asked the question I was
            thinking from "within" the IDE, but of course it makes sense to enumerate
            the files in the directory. I was thinking of VBA where you can program to
            the VBE and enumerate the lines of code without even having to get a handle
            on the physical file.

            Thanks.


            "RobinS" <RobinS@NoSpam. yah.nonewrote in message
            news:z7ednaqDuL Tkb0nYnZ2dnUVZ_ oupnZ2d@comcast .com...
            >I would recommend that you write a program in VB that lets you specify a
            >top folder (like where the solution is), and then it cycles through from
            >that folder down looking for programs with a file extension of vb. Just
            >read them as if they were text files and look at the code that way.
            >
            Robin S.
            --------------------------
            "Tim Zych" <FirstInitial+L astName@earth_L inkDotNetwrote in message
            news:eF0gmbSUHH A.4796@TK2MSFTN GP05.phx.gbl...
            >>I would like a way to scan the code in a vb.net project, say by creating a
            >>vb.net utility to cycle through each line of code related to a particular
            >>project and perform some analysis on it.
            >>
            >How do I program into the IDE? Did I ask that right? I need a way to
            >programmatical ly cycle through each line of code, for any code that's
            >related to a project.
            >>
            >thanks for any pointers.
            >>
            >>
            >
            >

            Comment

            • Lloyd Sheen

              #7
              Re: Programmaticall y read code in the IDE

              Tim,

              There are interfaces to program the IDE. I have not looked at that
              since VS 2003 but I don't think it is much different. I tried a simple
              example and it worked. At the time I did not find it easy to program but
              then again I didn't spend alot of time on it.

              If you go that route you can create your own toolbars , menus etc but
              that would be your decsion.

              LS

              "Tim Zych" <FirstInitial+L astName@earth_L inkDotNetwrote in message
              news:uWWKjOgUHH A.5060@TK2MSFTN GP06.phx.gbl...
              That's nice "out of the box" thinking. When I asked the question I was
              thinking from "within" the IDE, but of course it makes sense to enumerate
              the files in the directory. I was thinking of VBA where you can program to
              the VBE and enumerate the lines of code without even having to get a
              handle on the physical file.
              >
              Thanks.
              >
              >
              "RobinS" <RobinS@NoSpam. yah.nonewrote in message
              news:z7ednaqDuL Tkb0nYnZ2dnUVZ_ oupnZ2d@comcast .com...
              >>I would recommend that you write a program in VB that lets you specify a
              >>top folder (like where the solution is), and then it cycles through from
              >>that folder down looking for programs with a file extension of vb. Just
              >>read them as if they were text files and look at the code that way.
              >>
              >Robin S.
              >--------------------------
              >"Tim Zych" <FirstInitial+L astName@earth_L inkDotNetwrote in message
              >news:eF0gmbSUH HA.4796@TK2MSFT NGP05.phx.gbl.. .
              >>>I would like a way to scan the code in a vb.net project, say by creating
              >>>a vb.net utility to cycle through each line of code related to a
              >>>particular project and perform some analysis on it.
              >>>
              >>How do I program into the IDE? Did I ask that right? I need a way to
              >>programmatica lly cycle through each line of code, for any code that's
              >>related to a project.
              >>>
              >>thanks for any pointers.
              >>>
              >>>
              >>
              >>
              >
              >

              Comment

              • pfc_sadr@hotmail.com

                #8
                Re: Programmaticall y read code in the IDE

                thanks guys; does this mean I actually get points for being helpful?

                because I answered it correctly first??

                THANK YOU, THANK YOU, THANK YOU

                I miss the old ExpertsExchange ;)

                On Feb 16, 11:59 am, "Lloyd Sheen" <a...@b.cwrot e:
                Tim,
                >
                There are interfaces to program the IDE. I have not looked at that
                since VS 2003 but I don't think it is much different. I tried a simple
                example and it worked. At the time I did not find it easy to program but
                then again I didn't spend alot of time on it.
                >
                If you go that route you can create your own toolbars , menus etc but
                that would be your decsion.
                >
                LS
                >
                "Tim Zych" <FirstInitial+L astName@earth_L inkDotNetwrote in message
                >
                news:uWWKjOgUHH A.5060@TK2MSFTN GP06.phx.gbl...
                >
                That's nice "out of the box" thinking. When I asked the question I was
                thinking from "within" the IDE, but of course it makes sense to enumerate
                the files in the directory. I was thinking of VBA where you can program to
                the VBE and enumerate the lines of code without even having to get a
                handle on the physical file.
                >
                Thanks.
                >
                "RobinS" <Rob...@NoSpam. yah.nonewrote in message
                news:z7ednaqDuL Tkb0nYnZ2dnUVZ_ oupnZ2d@comcast .com...
                >I would recommend that you write a program in VB that lets you specify a
                >top folder (like where the solution is), and then it cycles through from
                >that folder down looking for programs with a file extension of vb. Just
                >read them as if they were text files and look at the code that way.
                >
                Robin S.
                --------------------------
                "Tim Zych" <FirstInitial+L astName@earth_L inkDotNetwrote in message
                >news:eF0gmbSUH HA.4796@TK2MSFT NGP05.phx.gbl.. .
                >>I would like a way to scan the code in a vb.net project, say by creating
                >>a vb.net utility to cycle through each line of code related to a
                >>particular project and perform some analysis on it.
                >
                >How do I program into the IDE? Did I ask that right? I need a way to
                >programmatical ly cycle through each line of code, for any code that's
                >related to a project.
                >
                >thanks for any pointers.

                Comment

                Working...