Loading...
Logo
Processing Forum
hi,

i am working on a processing project together with a friend. to avoid running into problems due to working on different versions of the project i was thinking about including a version counter into the project (sth like "current version: 0.143").
to avoid manually adjusting this counter (because that would be source of errors just as much as having no version counter at all) i want this counter to increase automatically by i.e. 0.001 every time the project is saved.
is there a way to catch the editors save process?

Replies(3)

do you mean i should change the source code of the sketch tool? i would really refrain from doing that...
or do you mean i can access the internal processes of the sketch tool by understanding it?
What I meant is that the functionality you describe is not available in Processing. However where libraries can enhance the possibilities of a sketch, tools can enhance the possibilities of the PDE. There are a few tools available such as the archive tool. You can find it in the menu via tools.

If you want additional functionality, like the one you describe, creating a small tool for this might be a possible route. Since the archive tool seemed closest to what you had in mind, I linked to it's source code as a source of inspiration. I've never made a tool myself, so I can't tell you if it's hard or not, but what you describe seems fairly straightforward. Wouldn't it just be either:
  1. a version.txt file in the sketch directory that holds the version number
  2. a version number at the end of the sketchname
...which in either case is incremented by 0.001 on each save.

Of course there are online services like googlecode, github and bitbucket that are more suitable for working on code collaboratively and have built-in version control functionality.