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.
IndexProgramming Questions & HelpSyntax Questions › One more question re: Table in "Visualizing Data"
Page Index Toggle Pages: 1
One more question re: Table in "Visualizing Data" (Read 485 times)
One more question re: Table in "Visualizing Data"
Jul 8th, 2009, 10:18am
 
Hello,

Sorry to keep bugging you all with these. Ok, so the Table class (found at http://benfry.com/writing/map/Table.pde) used for the Map example on pg 33 features the following chunk of code:

Quote:
  float getFloat(int rowIndex, int column) {
    return parseFloat(getString(rowIndex, column));
  }



which I think then sends you to this chunk of code:

Quote:
  String getString(int rowIndex, int column) {
    return data[rowIndex][column];
  }



which gets you the coordinates you need to put circles on your map. My confusion arises from this line:

Quote:
    return parseFloat(getString(rowIndex, column));



because I can't find parseFloat defined anywhere in the code. How does the program know what to do with parseFloat? What is parseFloat? How come it's not declared as a variable or a function?
Re: One more question Table in "Visualizing Data"
Reply #1 - Jul 8th, 2009, 10:52am
 
parseFloat() is a standard Java method for creating a new float based on the value represented by the string passed as an argument.

You can find it here in the Java doc.
Re: One more question Table in "Visualizing Data"
Reply #2 - Jul 8th, 2009, 11:17am
 
Awesome thank you!

I think I'm gonna go out and buy Java for Dummies.

Edit: OMG 900 pages nevermind
Page Index Toggle Pages: 1