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
   Syntax
(Moderators: fry, REAS)
   naming of strings
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: naming of strings  (Read 292 times)
c
Guest
Email
naming of strings
« on: Jun 26th, 2004, 12:36pm »

hi  
i wonder why this piece of code wont work;  
declaring a String works like this:
String names = "one, two, three";
String sNames = split(eins, ",");
   
now i want to declare new strings with the names  
of the list sNames:
 
 for(int i=0; i<sNames.length; i++)
    {
     
     String [] sNames[i];
     
    }
 
see the trouble?  
 
thanks  
christian
 
arielm

WWW
Re: naming of strings
« Reply #1 on: Jun 26th, 2004, 2:42pm »

this kind of constructs would probably work with javascript but not (directly) in java, because it's a compiled language (i.e. it's not processing strings containing "member" names at run-time...)
 
it is possible to use "java refection" to do such things (on field & method names), but 99% of the times, there's a simple, java-straightforward alternative.
 

Ariel Malka | www.chronotext.org
kevinP

Email
Re: naming of strings
« Reply #2 on: Jun 26th, 2004, 10:25pm »

on Jun 26th, 2004, 12:36pm, c wrote:

String sNames = split(eins, ",");

 
Where does the variable "eins" come from?
 

Kevin Pfeiffer
Pages: 1 

« Previous topic | Next topic »