473,418 Members | 2,075 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

Run code from IDE

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

Apr 8 '06 #1
19 2194
In debug mode you can write and execute in immediate window

"Bryan" <br*******@gmail.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.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

Apr 8 '06 #2
This is quite limited, for example you cannot declare variables.

--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net
"Carl-Johan Wik" <cj***@hotmail.com> wrote in message
news:eg****************@TK2MSFTNGP02.phx.gbl...
In debug mode you can write and execute in immediate window

"Bryan" <br*******@gmail.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.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


Apr 8 '06 #3
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?

Apr 8 '06 #4
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.

--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net
"Bryan" <br*******@gmail.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.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?

Apr 8 '06 #5
Bryan,

I just open them as form, keep the default name and clean all with those
default names up time by time.

:-)

Cor
Apr 8 '06 #6
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
Apr 8 '06 #7
|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.

--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net
"Peter Macej" <pe***@vbdocman.com> wrote in message
news:OB**************@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

Apr 8 '06 #8

"Bryan" <br*******@gmail.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.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?


I put it in a button click event or in form load.

Apr 8 '06 #9
> |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
Apr 8 '06 #10
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.

--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net
"Peter Macej" <pe***@vbdocman.com> wrote in message
news:OO**************@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

Apr 8 '06 #11
> 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.


Yes. The project is DLL (VS add-in) and most of the start time takes
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
Apr 8 '06 #12
Create a public sub in a module and you can call it from the Immediate
window. Paste codes you need to test there.

"Bryan" <br*******@gmail.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.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

Apr 9 '06 #13
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" <to******@earthlink.net> wrote in message
news:ug****************@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" <br*******@gmail.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.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


Apr 9 '06 #14
#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 )" <me@mine.com> wrote in message
news:uu**************@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" <to******@earthlink.net> wrote in message
news:ug****************@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" <br*******@gmail.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.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



Apr 9 '06 #15
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" <to******@earthlink.net> wrote in message
news:%2****************@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 )" <me@mine.com> wrote in message
news:uu**************@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" <to******@earthlink.net> wrote in message
news:ug****************@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" <br*******@gmail.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.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



Apr 10 '06 #16
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 )" <me@mine.com> wrote in message
news:u%****************@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" <to******@earthlink.net> wrote in message
news:%2****************@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 )" <me@mine.com> wrote in message
news:uu**************@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" <to******@earthlink.net> wrote in message
news:ug****************@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" <br*******@gmail.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.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
>



Apr 11 '06 #17
>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" <to******@earthlink.net> wrote in message
news:ei**************@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 )" <me@mine.com> wrote in message
news:u%****************@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" <to******@earthlink.net> wrote in message
news:%2****************@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 )" <me@mine.com> wrote in message
news:uu**************@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" <to******@earthlink.net> wrote in message
news:ug****************@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" <br*******@gmail.com> wrote in message
> news:11**********************@e56g2000cwe.googlegr oups.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
>>
>
>



Apr 11 '06 #18
>>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 )" <me@mine.com> wrote in message
news:OG**************@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" <to******@earthlink.net> wrote in message
news:ei**************@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 )" <me@mine.com> wrote in message
news:u%****************@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" <to******@earthlink.net> wrote in message
news:%2****************@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 )" <me@mine.com> wrote in message
news:uu**************@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" <to******@earthlink.net> wrote in message
> news:ug****************@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" <br*******@gmail.com> wrote in message
>> news:11**********************@e56g2000cwe.googlegr oups.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
>>>
>>
>>
>
>



Apr 12 '06 #19
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
a form without having to set it as the default start up form.

You can optionally run Sub Main and open up a form if required. Some windows
applications dont require a user interface so this would be appropriate in
such cases.

--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net

"+Vice" <to******@earthlink.net> wrote in message
news:%2****************@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 )" <me@mine.com> wrote in message
news:OG**************@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" <to******@earthlink.net> wrote in message
news:ei**************@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 )" <me@mine.com> wrote in message
news:u%****************@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" <to******@earthlink.net> wrote in message
news:%2****************@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 )" <me@mine.com> wrote in message
> news:uu**************@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" <to******@earthlink.net> wrote in message
>> news:ug****************@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" <br*******@gmail.com> wrote in message
>>> news:11**********************@e56g2000cwe.googlegr oups.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
>>>>
>>>
>>>
>>
>>
>
>



Apr 12 '06 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

51
by: Mudge | last post by:
Please, someone, tell me why OO in PHP is better than procedural.
9
by: bigoxygen | last post by:
Hi. I'm using a 3 tier FrontController Design for my web application right now. The problem is that I'm finding to have to duplicate a lot of code for similar functions; for example, listing...
4
by: jason | last post by:
Hello. Newbie on SQL and suffering through this. I have two tables created as such: drop table table1; go drop table table2; go
16
by: Dario de Judicibus | last post by:
I'm getting crazy. Look at this code: #include <string.h> #include <stdio.h> #include <iostream.h> using namespace std ; char ini_code = {0xFF, 0xFE} ; char line_sep = {0x20, 0x28} ;
109
by: Andrew Thompson | last post by:
It seems most people get there JS off web sites, which is entirely logical. But it is also a great pity since most of that code is of such poor quality. I was looking through the JS FAQ for any...
5
by: ED | last post by:
I currently have vba code that ranks employees based on their average job time ordered by their region, zone, and job code. I currently have vba code that will cycle through a query and ranks each...
0
by: Namratha Shah \(Nasha\) | last post by:
Hey Guys, Today we are going to look at Code Access Security. Code access security is a feature of .NET that manages code depending on its trust level. If the CLS trusts the code enough to...
18
by: Joe Fallon | last post by:
I have some complex logic which is fairly simply to build up into a string. I needed a way to Eval this string and return a Boolean result. This code works fine to achieve that goal. My...
37
by: Alan Silver | last post by:
Hello, Newbie here, so please forgive what is probably a basic question ... I see a lot of discussion about "code behind", which if I have understood correctly, means that the script code goes...
171
by: tshad | last post by:
I am just trying to decide whether to split my code and uses code behind. I did it with one of my pages and found it was quite a bit of trouble. I know that most people (and books and articles)...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.