Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   EasyC Copy & Paste (http://www.chiefdelphi.com/forums/showthread.php?t=61774)

aeasson 15-01-2008 22:38

EasyC Copy & Paste
 
If a function is written within EasyC using the drag & drop coding blocks. Is there any way to copy the code within that function to another function so that you can modify it for a slightly different use? Or can you copy the whole function and give it a different name?

Kingofl337 16-01-2008 10:41

Re: EasyC Copy & Paste
 
You can do both.

1.) Right click on your function can click copy function easyC will ask for a new function name.

2.) You can copy multiple blocks using shift / control just like any other windows app :)

Chris_Elston 16-01-2008 12:57

Re: EasyC Copy & Paste
 
How about this.

Three programmers. Each with is own copy of EasyC. Each programmer working on a Function, and one MASTER CODE.

Can we copy and paste a function from programmer #1 EasyC file to the MASTER CODE EasyC file?

We tried running two instances of EasyC on the same laptop, and copy between the two applications, but that does not work....

We have "teams" of programmers and it's hard to share with each other, with out recoding the entire function in the MASTER COPY...

Alan Anderson 22-01-2008 23:52

Re: EasyC Copy & Paste
 
Quote:

Originally Posted by Chris_Elston (Post 679294)
Can we copy and paste a function from programmer #1 EasyC file to the MASTER CODE EasyC file?

I don't have a copy of the software handy at the moment, so forgive any minor inaccuracies in what I'm about to say.

When you right-click on the user functions, you get two options. One is to make a new function. The other is to copy an existing function from another project. I think that does what you want.

(You apparently can't copy the Initialize or Autonomous or OperatorControl functions, but a bit of creative copy & paste in both the source and target projects can work around that restriction.)

Chris_Elston 24-01-2008 09:21

Re: EasyC Copy & Paste
 
Quote:

Originally Posted by Alan Anderson (Post 684072)
When you right-click on the user functions, you get two options. One is to make a new function. The other is to copy an existing function from another project. I think that does what you want.

Why didn't I ever notice that before...that will work for what I am doing. It does not import variables...that's a good thing and a bad thing, but I'll take it! Saves alot of time reconstructing the EasyC Blocks.

I see that if somehow I export a function in another project as a library file, I can then attach with it, macros, variables, and code. That might be the way to go to move massive amounts of functions around from team member to team member.

Kingofl337 24-01-2008 15:10

Re: EasyC Copy & Paste
 
If you save a project as a library it will import variables.

SgtMillhouse648 24-01-2008 16:48

Re: EasyC Copy & Paste
 
You could use the approach we are using this year. We have a total of 6 programmers each working on their own seperate parts of the code. To get around this, we have a "master program" which is just made up of seperate functions (in operator control, two functions are used, operator drive and operator arm for ex.) Each person works on their own seperate function, ex, I work on operator arm. I make any variables I use local variables, and when we import the function into the master code, outside of rewriting a couple of constants under the global category, it is pretty much copy and play.


All times are GMT -5. The time now is 23:10.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi