NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
November 20, 2017, 07:11:30 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
"Wisdom is the harmony, healthy and happiness in life." ...Wisdom
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 7616 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  
"Wisdom is the harmony, healthy and happiness in life." ...Wisdom
 
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.044 seconds with 21 queries.since 2011/06/15