PDA

View Full Version : EasyC Copy & Paste


aeasson
01-15-2008, 10:38 PM
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
01-16-2008, 10:41 AM
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
01-16-2008, 12:57 PM
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
01-22-2008, 11:52 PM
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
01-24-2008, 09:21 AM
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
01-24-2008, 03:10 PM
If you save a project as a library it will import variables.

SgtMillhouse648
01-24-2008, 04:48 PM
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.