NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
December 13, 2018, 04:38:19 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Discovery consists of seeing what everybody has seen and thinking what nobody has thought. ..."Albert von Szent-Gyorgyi(1893-1986, 1937 Nobel Prize for Medicine, Lived to 93)"
Google Bookmarks Yahoo My Web MSN Live Netscape Del.icio.us FURL Stumble Upon Delirious Ask FaceBook

Pages: [1]   Go Down
  Print  
Author Topic: Hoe to declare arrays in EJS  (Read 8272 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
Fred Chuit
Newbie
*
Offline Offline

Posts: 18



«
Embed this message
on: December 24, 2008, 01:26:30 am » posted from:Meppel,Drenthe,Netherlands

Dear EJS-users,

I can not find info how to declare arrays on the variable page of EJS.
I would like to use single and multi dimension arrays of strings and arrays of double.
What do I have to fill in in the coloms: Name Value Type Dimension.

Already many thanks for your help.
Regards,
Fred.
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #1 on: December 24, 2008, 07:10:01 am » posted from:Taipei,T'ai-pei,Taiwan

In the last column for the variable type in [3],then you will have 1D array with 3 element.
Type in [3][5] then you will have 2D array.
Normally, I will define variables for # of elements,
e.g.: nx=3,ny=5, then type in [nx][ny]

If you check out simulations posted in this forum with many particles/elements,
you can download ejs source and find out how it was defined.
Logged
Pages: [1]   Go Up
  Print  
Discovery consists of seeing what everybody has seen and thinking what nobody has thought. ..."Albert von Szent-Gyorgyi(1893-1986, 1937 Nobel Prize for Medicine, Lived to 93)"
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.045 seconds with 22 queries.since 2011/06/15