Solved

Multi Dimensional Arrays?????????

Posted on 1998-05-23
1
278 Views
Last Modified: 2010-04-16
Can anyone explain how I go about setting up and using a multi dimensional array. I have to write a program that will calculate the standard deviation of a bunch of numbers. The thing is though, there are about 6 lots of numbers. I can do a sinlge array ( ???? : Array [1..120] of real ) but for more columns I'm completely stuck. PLEASE HELP!!!
0
Comment
Question by:Dave091277
1 Comment
 
LVL 1

Accepted Solution

by:
jackb022197 earned 50 total points
ID: 1217036
As an example: This is how you would create a two-dimensional array that can hold all the values in a table that contains 20 columns and 20 rows:

type
 TTable = array[1..20, 1..20] of Double;

Then you can declare a variable of the TTable type:

var
 BigTable: TTable;

To initialize all the values in the table to 0.0, you could use nested for loops:

var
 Col, Row: Integer;
...
for Col := 1 to 20 do
 for Row:= 1 to 20 do
   BigTable[Col, Row] := 0.0
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you are looking at this article, you have most likely been hit by some version of ransomware and are trying to find out if there is anything you can do, or what way you should react - READ ON!
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question