We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Code reuse or repository
Page Index Toggle Pages: 1
Code reuse or repository (Read 439 times)
Code reuse or repository
Apr 27th, 2006, 8:32pm
 
I'm just wondering if there's a quick (perhaps dirty) method to set up some sort of inter-sketch code share system. I have many sketches that use the same classes, and I'd like to reduce the amounts of copy/pasting to update all the sketches that use those classes. Since I'll be updating and changing them often I don't want to make a library.

A CVS is unnecessary, but simply a way to point to a 'shared' folder would be nice. I tried using shortcuts and aliases that point to PDEs in a shared folder, but that didn't work.
Re: Code reuse or repository
Reply #1 - Apr 27th, 2006, 10:48pm
 
Have you tried using symbolic or hard links to manage pdes? Might be worth a try. I'll admit, it's kind of a POS way, if it works.

The quickest way, sadly, might simply be writing libs, however you are limited to doing certain things that way.

I'll lend you my brain and think over this during the course of today.

Just to clarify, the idea is to have some sort of #include correct? An libs are different in that 1) They are straight java 2) they have to obtain a pointer to PApplet every time an object is instantiated from the lib.

Whereas a straight #include would simply attatch a .pde as if it were a tab, but the .pde could be at any specificed location.
Re: Code reuse or repository
Reply #2 - Apr 28th, 2006, 12:58am
 
I did try symbolic links, but Processing didn't follow them.

The #include system could work, but in the spirit of Processing there shouldn't be an include command ... maybe a simple Add External command to include an external pde file, adding it to the project while allowing it to be edited.
Re: Code reuse or repository
Reply #3 - Apr 28th, 2006, 8:01am
 
one thing to think of: what happens if you alter that external pde?
you don't want to break all your previous sketches at once.

maybe it should rather be an "copy pde from" / reuse than an include. that way you still have one folder containing everything and won't break anything. it might even be interessting to have a "reuse class / function from" ... a code oriented menu instead of a file-oriented one.

why don't you just create some sketches as templates and instead of starting with "new" start with "save as" ... these then could include your default tabs.

best,
F
Page Index Toggle Pages: 1