View Single Post
  #1 (permalink)  
Old 07-18-2007, 01:39 PM
madad2005 madad2005 is offline
Member
 
Join Date: Jul 2007
Posts: 2
madad2005 is on a distinguished road
building file and variable names from variables
Hi,

I'm fairly new to java, but need some help with converting what is an easy action in scripting languages but usually not so easy in programming languages. In scripting I would do the following (in pseudo-codish):

for i=0 , i<10 , i++
print "hello world no. $i"
open "filename$i"
readin "filename$i"
var.$i = var.$i + var.$(i-1)
done

Note the use of the $i. How can I do this in Java? I can do it in C and Fortran, but can't seem to find a reference on how to do it in Java. (The specific commands I used above are an example only)

Thanks for your help.
Reply With Quote
Sponsored Links