NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
October 17, 2018, 11:34:49 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  
Life is an inspiration. ..."Mahatma Gandhi(1869-1984, The greatest leader of modern India)"
Google Bookmarks Yahoo My Web MSN Live Netscape Del.icio.us FURL Stumble Upon Delirious Ask FaceBook

Pages: [1]   Go Down
Author Topic: Hoe to declare arrays in EJS  (Read 8204 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
Fred Chuit
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.
Fu-Kwun Hwang
Hero Member
Offline Offline

Posts: 3080

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.
Pages: [1]   Go Up
Life is an inspiration. ..."Mahatma Gandhi(1869-1984, The greatest leader of modern India)"
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 5.046 seconds with 21 queries.since 2011/06/15