FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Programs
(Moderators: fry, REAS)
   passing parameters in shell
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: passing parameters in shell  (Read 1022 times)
michael05

WWW
passing parameters in shell
« on: Jul 10th, 2004, 10:06pm »

hello
 
i am searching for a way to pass parameters like width and height or the location of an image to a processing applet in the shell. is there a way?
 
adding it to BApplet would be easy. but i do not know how to pass a parameter to "applet" does not work.
 
i defined a String [] parameter in my project. in BApplet i can not assign applet.parameter = ...;
 
BApplet
...
Frame frame = new Frame();
   Class c = Class.forName(args[0]);
   BApplet applet = (BApplet) c.newInstance();
   applet.init();
   applet.start();
   applet.parameter = args[0];
...
 
 
my project
...
public class overlays02 extends BApplet{
 
 // screenWidth, screenHeight, mode, backGround, imageLoc
 String [] parameters = new String [5];
...
 

°°°°°°°°°°°°°°°°°°°°
http://www.m05.de
fjen

WWW
Re: passing parameters in shell
« Reply #1 on: Jul 13th, 2004, 9:22pm »

hi michael,
 
once you cast back to BApplet in line:
 
BApplet applet = (BApplet) c.newInstance();
 
you will lose your parameters variable ... maybe try this: extend BApplet with just that variable (say as BAppletP), then extend BAppletP with your project-classes. see link ...
 
http://www.florianjenett.de/p55/parsing_parameters.java
« Last Edit: Jul 17th, 2004, 8:58am by fjen »  
Pages: 1 

« Previous topic | Next topic »