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.
IndexSuggestions & BugsSoftware Bugs › sketchPath() and dataPath()
Page Index Toggle Pages: 1
sketchPath() and dataPath() (Read 3013 times)
sketchPath() and dataPath()
Nov 28th, 2005, 11:52am
 
Hi ben,

Don't want to file this as a bug quite yet, since these functions are not formally documented yet, and don't know if it really is.

In my library I use the new methods sketchPath() and dataPath() and in the release it was stated that they return the data path and the sketch path, but it seems they require an argument, is this a bug?

Code:

./geomerative/RFont.java:86: dataPath(java.lang.String) in processing.core.PApplet cannot be applied to ()
fontPathAlt = parent.dataPath()+File.separator+fontPath;
^
./geomerative/RFont.java:90: sketchPath(java.lang.String) in processing.core.PApplet cannot be applied to ()
fontPathAlt = parent.sketchPath()+File.separator+fontPath;
Re: sketchPath() and dataPath()
Reply #1 - Nov 28th, 2005, 11:58am
 
Ok, I checked the source code and it's not a bug, it's rather the way it works.

dataPath(String file) and sketchPath(String file) prepend the data and sketch paths to the strings passed as argument.
Re: sketchPath() and dataPath()
Reply #2 - Nov 28th, 2005, 2:10pm
 
right, because whenever you use them, you usually are setting the path to something, for instance your code:
fontPathAlt = parent.dataPath()+File.separator+fontPath
would instead just be:
fontPathAlt = parent.dataPath(fontPath);

the release notes are just poorly writen, with the expectation that the javadoc will be what people use (though i haven't had a chance to update the javadoc yet).
Page Index Toggle Pages: 1