|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Run code from IDEHow can i run a bit of code straight from the IDE? Right now i make a
temporary button and put the code behind that, then i run debug mode and click on the button. Is there a way to highlight some code and tell it to run that? Is there a "scratchpad" type window like in VBA where I can write some simple code to be executed? Thanks for the help in advance In debug mode you can write and execute in immediate window
Show quoteHide quote "Bryan" <bryanv***@gmail.com> wrote in message news:1144482924.034430.209940@e56g2000cwe.googlegroups.com... > How can i run a bit of code straight from the IDE? Right now i make a > temporary button and put the code behind that, then i run debug mode > and click on the button. Is there a way to highlight some code and > tell it to run that? Is there a "scratchpad" type window like in VBA > where I can write some simple code to be executed? Thanks for the help > in advance > This is quite limited, for example you cannot declare variables.
Show quoteHide quote "Carl-Johan Wik" <cj***@hotmail.com> wrote in message news:egT8%23muWGHA.4484@TK2MSFTNGP02.phx.gbl... > In debug mode you can write and execute in immediate window > > "Bryan" <bryanv***@gmail.com> wrote in message > news:1144482924.034430.209940@e56g2000cwe.googlegroups.com... >> How can i run a bit of code straight from the IDE? Right now i make a >> temporary button and put the code behind that, then i run debug mode >> and click on the button. Is there a way to highlight some code and >> tell it to run that? Is there a "scratchpad" type window like in VBA >> where I can write some simple code to be executed? Thanks for the help >> in advance >> > > I wish there was a way to run a single sub or function, or even to open
a form without having to set it as the default start up form. Maybe I am missing something When you guys want to test little things or run a little maintenece procedure, what do you do? OK, well just because you are writing a windows applications it doesent mean
you need a user interface. You can remove the form and use a sub main in a module. you can put your code in there. Show quoteHide quote "Bryan" <bryanv***@gmail.com> wrote in message news:1144489756.535106.149310@u72g2000cwu.googlegroups.com... >I wish there was a way to run a single sub or function, or even to open > a form without having to set it as the default start up form. Maybe I > am missing something When you guys want to test little things or run a > little maintenece procedure, what do you do? > Bryan,
I just open them as form, keep the default name and clean all with those default names up time by time. :-) Cor"Bryan" <bryanv***@gmail.com> wrote in message I put it in a button click event or in form load.news:1144489756.535106.149310@u72g2000cwu.googlegroups.com... > I wish there was a way to run a single sub or function, or even to open > a form without having to set it as the default start up form. Maybe I > am missing something When you guys want to test little things or run a > little maintenece procedure, what do you do? This article of mine may help you:
http://www.vbdocman.com/blog/archives/21 -- Peter Macej Helixoft - http://www.vbdocman.com VBdocman - Automatic generator of technical documentation for VB, VB ..NET and ASP .NET code |I read your article, but without being rude in any way, I dont see that your methods in step 3 or 4 are functionally any different from what you say is cumbersome in step 1. In fact I think its more cumbersome and has no particular advantage wrt trying out a snippet of code. Things changed with the advent of .NET and people are just going to have to get over it. In all honesty when you are writing code everyday for seven hours a day, you get better at preventing compiler or runtime failures and its not such an issue. Show quoteHide quote "Peter Macej" <pe***@vbdocman.com> wrote in message news:OBIKEMxWGHA.2376@TK2MSFTNGP03.phx.gbl... > This article of mine may help you: > http://www.vbdocman.com/blog/archives/21 > > -- > Peter Macej > Helixoft - http://www.vbdocman.com > VBdocman - Automatic generator of technical documentation for VB, VB .NET > and ASP .NET code > |I read your article, but without being rude in any way, I dont see that My experience is this:> your methods in step 3 or 4 are functionally any different from what you say > is cumbersome in step 1. In fact I think its more cumbersome and has no > particular advantage wrt trying out a snippet of code. The project I'm working on takes about 10 seconds to compile and about 30 seconds to start. This is 40 seconds. Just to see whether, for example some regular expression I wrote is correct. Opening Snipped Editor, pasting two lines of code and executing takes me about 10 seconds. With macro IDE it is even faster. -- Peter Macej Helixoft - http://www.vbdocman.com VBdocman - Automatic generator of technical documentation for VB, VB ..NET and ASP .NET code 40 seconds is a long time, I think perhaps you may want to think about
compiling some of your code into libararies as this is way too long. Show quoteHide quote "Peter Macej" <pe***@vbdocman.com> wrote in message news:OO4$y4yWGHA.3448@TK2MSFTNGP03.phx.gbl... >> |I read your article, but without being rude in any way, I dont see that >> your methods in step 3 or 4 are functionally any different from what you >> say is cumbersome in step 1. In fact I think its more cumbersome and has >> no particular advantage wrt trying out a snippet of code. > > My experience is this: > The project I'm working on takes about 10 seconds to compile and about 30 > seconds to start. This is 40 seconds. Just to see whether, for example > some regular expression I wrote is correct. Opening Snipped Editor, > pasting two lines of code and executing takes me about 10 seconds. With > macro IDE it is even faster. > > > -- > Peter Macej > Helixoft - http://www.vbdocman.com > VBdocman - Automatic generator of technical documentation for VB, VB .NET > and ASP .NET code > 40 seconds is a long time, I think perhaps you may want to think about Yes. The project is DLL (VS add-in) and most of the start time takes > compiling some of your code into libararies as this is way too long. launching of another VS instance which is DLL's host. I agree that with normal programs this is not an issue. -- Peter Macej Helixoft - http://www.vbdocman.com VBdocman - Automatic generator of technical documentation for VB, VB ..NET and ASP .NET code Create a public sub in a module and you can call it from the Immediate
window. Paste codes you need to test there. Show quoteHide quote "Bryan" <bryanv***@gmail.com> wrote in message news:1144482924.034430.209940@e56g2000cwe.googlegroups.com... > How can i run a bit of code straight from the IDE? Right now i make a > temporary button and put the code behind that, then i run debug mode > and click on the button. Is there a way to highlight some code and > tell it to run that? Is there a "scratchpad" type window like in VBA > where I can write some simple code to be executed? Thanks for the help > in advance > How does this help ?, the code in the module has still to be compiled.
Show quoteHide quote "+Vice" <tonyp***@earthlink.net> wrote in message news:ugKb9%239WGHA.3440@TK2MSFTNGP02.phx.gbl... > Create a public sub in a module and you can call it from the Immediate > window. Paste codes you need to test there. > > "Bryan" <bryanv***@gmail.com> wrote in message > news:1144482924.034430.209940@e56g2000cwe.googlegroups.com... >> How can i run a bit of code straight from the IDE? Right now i make a >> temporary button and put the code behind that, then i run debug mode >> and click on the button. Is there a way to highlight some code and >> tell it to run that? Is there a "scratchpad" type window like in VBA >> where I can write some simple code to be executed? Thanks for the help >> in advance >> > > #1 - When you run the code, the program automatically recompiles so it's
pretty transparent. #2 - He's not stating he doesn't want to have to recompile. #3 - How are you contributing? Show quoteHide quote "OHM ( One Handed Man )" <m*@mine.com> wrote in message news:uuVM3F$WGHA.1192@TK2MSFTNGP03.phx.gbl... > How does this help ?, the code in the module has still to be compiled. > > -- > ( OHM ) - One Handed Man > AKA Terry Burns - http://TrainingOn.net > > "+Vice" <tonyp***@earthlink.net> wrote in message > news:ugKb9%239WGHA.3440@TK2MSFTNGP02.phx.gbl... >> Create a public sub in a module and you can call it from the Immediate >> window. Paste codes you need to test there. >> >> "Bryan" <bryanv***@gmail.com> wrote in message >> news:1144482924.034430.209940@e56g2000cwe.googlegroups.com... >>> How can i run a bit of code straight from the IDE? Right now i make a >>> temporary button and put the code behind that, then i run debug mode >>> and click on the button. Is there a way to highlight some code and >>> tell it to run that? Is there a "scratchpad" type window like in VBA >>> where I can write some simple code to be executed? Thanks for the help >>> in advance >>> >> >> > > Yes, he has implied he didnt want to recompile, if you read up he has
compared the immediate window in pre-.net basic where code was interpreted, and if you read-up, you will see I have already contributed, and this post is a continuation of that contribution. Compilation and load can take up to a minute if you are writing large solutions, but perhaps you're still on "Hello World"? Show quoteHide quote "+Vice" <tonyp***@earthlink.net> wrote in message news:%23SakMb$WGHA.4424@TK2MSFTNGP05.phx.gbl... > #1 - When you run the code, the program automatically recompiles so it's > pretty transparent. > #2 - He's not stating he doesn't want to have to recompile. > #3 - How are you contributing? > > "OHM ( One Handed Man )" <m*@mine.com> wrote in message > news:uuVM3F$WGHA.1192@TK2MSFTNGP03.phx.gbl... >> How does this help ?, the code in the module has still to be compiled. >> >> -- >> ( OHM ) - One Handed Man >> AKA Terry Burns - http://TrainingOn.net >> >> "+Vice" <tonyp***@earthlink.net> wrote in message >> news:ugKb9%239WGHA.3440@TK2MSFTNGP02.phx.gbl... >>> Create a public sub in a module and you can call it from the Immediate >>> window. Paste codes you need to test there. >>> >>> "Bryan" <bryanv***@gmail.com> wrote in message >>> news:1144482924.034430.209940@e56g2000cwe.googlegroups.com... >>>> How can i run a bit of code straight from the IDE? Right now i make a >>>> temporary button and put the code behind that, then i run debug mode >>>> and click on the button. Is there a way to highlight some code and >>>> tell it to run that? Is there a "scratchpad" type window like in VBA >>>> where I can write some simple code to be executed? Thanks for the help >>>> in advance >>>> >>> >>> >> >> > > Yes I agree, you contributed with code in sub Main of a module and I suppose
your super solution doesn't require compilation? You should be writing Hello World if you ask me. Show quoteHide quote "OHM ( One Handed Man )" <m*@mine.com> wrote in message news:u%23ECRoFXGHA.3660@TK2MSFTNGP04.phx.gbl... > Yes, he has implied he didnt want to recompile, if you read up he has > compared the immediate window in pre-.net basic where code was > interpreted, and if you read-up, you will see I have already contributed, > and this post is a continuation of that contribution. Compilation and load > can take up to a minute if you are writing large solutions, but perhaps > you're still on "Hello World"? > > -- > ( OHM ) - One Handed Man > AKA Terry Burns - http://TrainingOn.net > > > "+Vice" <tonyp***@earthlink.net> wrote in message > news:%23SakMb$WGHA.4424@TK2MSFTNGP05.phx.gbl... >> #1 - When you run the code, the program automatically recompiles so it's >> pretty transparent. >> #2 - He's not stating he doesn't want to have to recompile. >> #3 - How are you contributing? >> >> "OHM ( One Handed Man )" <m*@mine.com> wrote in message >> news:uuVM3F$WGHA.1192@TK2MSFTNGP03.phx.gbl... >>> How does this help ?, the code in the module has still to be compiled. >>> >>> -- >>> ( OHM ) - One Handed Man >>> AKA Terry Burns - http://TrainingOn.net >>> >>> "+Vice" <tonyp***@earthlink.net> wrote in message >>> news:ugKb9%239WGHA.3440@TK2MSFTNGP02.phx.gbl... >>>> Create a public sub in a module and you can call it from the Immediate >>>> window. Paste codes you need to test there. >>>> >>>> "Bryan" <bryanv***@gmail.com> wrote in message >>>> news:1144482924.034430.209940@e56g2000cwe.googlegroups.com... >>>>> How can i run a bit of code straight from the IDE? Right now i make a >>>>> temporary button and put the code behind that, then i run debug mode >>>>> and click on the button. Is there a way to highlight some code and >>>>> tell it to run that? Is there a "scratchpad" type window like in VBA >>>>> where I can write some simple code to be executed? Thanks for the help >>>>> in advance >>>>> >>>> >>>> >>> >>> >> >> > > >I wish there was a way to run a single sub or function, or even to open My response was accurate, you simple didnt read it.>a form without having to set it as the default start up form. Show quoteHide quote "+Vice" <tonyp***@earthlink.net> wrote in message news:eil6X4QXGHA.1192@TK2MSFTNGP03.phx.gbl... > Yes I agree, you contributed with code in sub Main of a module and I > suppose your super solution doesn't require compilation? You should be > writing Hello World if you ask me. > > "OHM ( One Handed Man )" <m*@mine.com> wrote in message > news:u%23ECRoFXGHA.3660@TK2MSFTNGP04.phx.gbl... >> Yes, he has implied he didnt want to recompile, if you read up he has >> compared the immediate window in pre-.net basic where code was >> interpreted, and if you read-up, you will see I have already contributed, >> and this post is a continuation of that contribution. Compilation and >> load can take up to a minute if you are writing large solutions, but >> perhaps you're still on "Hello World"? >> >> -- >> ( OHM ) - One Handed Man >> AKA Terry Burns - http://TrainingOn.net >> >> >> "+Vice" <tonyp***@earthlink.net> wrote in message >> news:%23SakMb$WGHA.4424@TK2MSFTNGP05.phx.gbl... >>> #1 - When you run the code, the program automatically recompiles so it's >>> pretty transparent. >>> #2 - He's not stating he doesn't want to have to recompile. >>> #3 - How are you contributing? >>> >>> "OHM ( One Handed Man )" <m*@mine.com> wrote in message >>> news:uuVM3F$WGHA.1192@TK2MSFTNGP03.phx.gbl... >>>> How does this help ?, the code in the module has still to be compiled. >>>> >>>> -- >>>> ( OHM ) - One Handed Man >>>> AKA Terry Burns - http://TrainingOn.net >>>> >>>> "+Vice" <tonyp***@earthlink.net> wrote in message >>>> news:ugKb9%239WGHA.3440@TK2MSFTNGP02.phx.gbl... >>>>> Create a public sub in a module and you can call it from the Immediate >>>>> window. Paste codes you need to test there. >>>>> >>>>> "Bryan" <bryanv***@gmail.com> wrote in message >>>>> news:1144482924.034430.209940@e56g2000cwe.googlegroups.com... >>>>>> How can i run a bit of code straight from the IDE? Right now i make >>>>>> a >>>>>> temporary button and put the code behind that, then i run debug mode >>>>>> and click on the button. Is there a way to highlight some code and >>>>>> tell it to run that? Is there a "scratchpad" type window like in VBA >>>>>> where I can write some simple code to be executed? Thanks for the >>>>>> help >>>>>> in advance >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > >>OK, well just because you are writing a windows applications it doesent That was your response but note how does that differ from mine? Try >>mean you need a user interface. You can remove the form and use a sub main >>in a module. you can put your code in there. returning something from Sub Main. As he stated, a way to run a single SUB or FUNCTION and my solution was to create a PUBLIC SUB or FUNCTION in a module so you can call it directly from the immediate window. And what was your response to that? How does this help? It still needs to be compiled. Hello World? Who didn't simply read what? Show quoteHide quote "OHM ( One Handed Man )" <m*@mine.com> wrote in message news:OGEE9LZXGHA.3908@TK2MSFTNGP02.phx.gbl... > >I wish there was a way to run a single sub or function, or even to open >>a form without having to set it as the default start up form. > > My response was accurate, you simple didnt read it. > > -- > ( OHM ) - One Handed Man > AKA Terry Burns - http://TrainingOn.net > > > "+Vice" <tonyp***@earthlink.net> wrote in message > news:eil6X4QXGHA.1192@TK2MSFTNGP03.phx.gbl... >> Yes I agree, you contributed with code in sub Main of a module and I >> suppose your super solution doesn't require compilation? You should be >> writing Hello World if you ask me. >> >> "OHM ( One Handed Man )" <m*@mine.com> wrote in message >> news:u%23ECRoFXGHA.3660@TK2MSFTNGP04.phx.gbl... >>> Yes, he has implied he didnt want to recompile, if you read up he has >>> compared the immediate window in pre-.net basic where code was >>> interpreted, and if you read-up, you will see I have already >>> contributed, and this post is a continuation of that contribution. >>> Compilation and load can take up to a minute if you are writing large >>> solutions, but perhaps you're still on "Hello World"? >>> >>> -- >>> ( OHM ) - One Handed Man >>> AKA Terry Burns - http://TrainingOn.net >>> >>> >>> "+Vice" <tonyp***@earthlink.net> wrote in message >>> news:%23SakMb$WGHA.4424@TK2MSFTNGP05.phx.gbl... >>>> #1 - When you run the code, the program automatically recompiles so >>>> it's pretty transparent. >>>> #2 - He's not stating he doesn't want to have to recompile. >>>> #3 - How are you contributing? >>>> >>>> "OHM ( One Handed Man )" <m*@mine.com> wrote in message >>>> news:uuVM3F$WGHA.1192@TK2MSFTNGP03.phx.gbl... >>>>> How does this help ?, the code in the module has still to be compiled. >>>>> >>>>> -- >>>>> ( OHM ) - One Handed Man >>>>> AKA Terry Burns - http://TrainingOn.net >>>>> >>>>> "+Vice" <tonyp***@earthlink.net> wrote in message >>>>> news:ugKb9%239WGHA.3440@TK2MSFTNGP02.phx.gbl... >>>>>> Create a public sub in a module and you can call it from the >>>>>> Immediate window. Paste codes you need to test there. >>>>>> >>>>>> "Bryan" <bryanv***@gmail.com> wrote in message >>>>>> news:1144482924.034430.209940@e56g2000cwe.googlegroups.com... >>>>>>> How can i run a bit of code straight from the IDE? Right now i make >>>>>>> a >>>>>>> temporary button and put the code behind that, then i run debug mode >>>>>>> and click on the button. Is there a way to highlight some code and >>>>>>> tell it to run that? Is there a "scratchpad" type window like in >>>>>>> VBA >>>>>>> where I can write some simple code to be executed? Thanks for the >>>>>>> help >>>>>>> in advance >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > As a matter of fact you although you cant return anything from a Sub, you
can alter object passed to it, but that is not the issue. He asked two questions. 1.) Could he run a function from an immediate window. This has been discussed to death and there is no point talking about it further. 2.) Could he simple call a from a function ? >I wish there was a way to run a single sub or function, or even to open You can optionally run Sub Main and open up a form if required. Some windows >a form without having to set it as the default start up form. applications dont require a user interface so this would be appropriate in such cases. Show quoteHide quote "+Vice" <tonyp***@earthlink.net> wrote in message news:%23ky7sldXGHA.1084@TK2MSFTNGP04.phx.gbl... >>>OK, well just because you are writing a windows applications it doesent >>>mean you need a user interface. You can remove the form and use a sub >>>main in a module. you can put your code in there. > > That was your response but note how does that differ from mine? Try > returning something from Sub Main. As he stated, a way to run a single > SUB or FUNCTION and my solution was to create a PUBLIC SUB or FUNCTION in > a module so you can call it directly from the immediate window. And what > was your response to that? How does this help? It still needs to be > compiled. Hello World? Who didn't simply read what? > > > "OHM ( One Handed Man )" <m*@mine.com> wrote in message > news:OGEE9LZXGHA.3908@TK2MSFTNGP02.phx.gbl... >> >I wish there was a way to run a single sub or function, or even to open >>>a form without having to set it as the default start up form. >> >> My response was accurate, you simple didnt read it. >> >> -- >> ( OHM ) - One Handed Man >> AKA Terry Burns - http://TrainingOn.net >> >> >> "+Vice" <tonyp***@earthlink.net> wrote in message >> news:eil6X4QXGHA.1192@TK2MSFTNGP03.phx.gbl... >>> Yes I agree, you contributed with code in sub Main of a module and I >>> suppose your super solution doesn't require compilation? You should be >>> writing Hello World if you ask me. >>> >>> "OHM ( One Handed Man )" <m*@mine.com> wrote in message >>> news:u%23ECRoFXGHA.3660@TK2MSFTNGP04.phx.gbl... >>>> Yes, he has implied he didnt want to recompile, if you read up he has >>>> compared the immediate window in pre-.net basic where code was >>>> interpreted, and if you read-up, you will see I have already >>>> contributed, and this post is a continuation of that contribution. >>>> Compilation and load can take up to a minute if you are writing large >>>> solutions, but perhaps you're still on "Hello World"? >>>> >>>> -- >>>> ( OHM ) - One Handed Man >>>> AKA Terry Burns - http://TrainingOn.net >>>> >>>> >>>> "+Vice" <tonyp***@earthlink.net> wrote in message >>>> news:%23SakMb$WGHA.4424@TK2MSFTNGP05.phx.gbl... >>>>> #1 - When you run the code, the program automatically recompiles so >>>>> it's pretty transparent. >>>>> #2 - He's not stating he doesn't want to have to recompile. >>>>> #3 - How are you contributing? >>>>> >>>>> "OHM ( One Handed Man )" <m*@mine.com> wrote in message >>>>> news:uuVM3F$WGHA.1192@TK2MSFTNGP03.phx.gbl... >>>>>> How does this help ?, the code in the module has still to be >>>>>> compiled. >>>>>> >>>>>> -- >>>>>> ( OHM ) - One Handed Man >>>>>> AKA Terry Burns - http://TrainingOn.net >>>>>> >>>>>> "+Vice" <tonyp***@earthlink.net> wrote in message >>>>>> news:ugKb9%239WGHA.3440@TK2MSFTNGP02.phx.gbl... >>>>>>> Create a public sub in a module and you can call it from the >>>>>>> Immediate window. Paste codes you need to test there. >>>>>>> >>>>>>> "Bryan" <bryanv***@gmail.com> wrote in message >>>>>>> news:1144482924.034430.209940@e56g2000cwe.googlegroups.com... >>>>>>>> How can i run a bit of code straight from the IDE? Right now i >>>>>>>> make a >>>>>>>> temporary button and put the code behind that, then i run debug >>>>>>>> mode >>>>>>>> and click on the button. Is there a way to highlight some code and >>>>>>>> tell it to run that? Is there a "scratchpad" type window like in >>>>>>>> VBA >>>>>>>> where I can write some simple code to be executed? Thanks for the >>>>>>>> help >>>>>>>> in advance >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > >
Save graphics image to bitmap?
Applications sharing Forms Authentication VB2005 -> OLEDB Connectivity question OptionExplicit How can I know my application's path? programm crashs when instancing new object decimal serious problem How do I get a gradualy changing colors? Form fade in Command line parameters |
|||||||||||||||||||||||