?
Solved

3D Dynamic Array

Posted on 2010-01-11
6
Medium Priority
?
249 Views
Last Modified: 2012-05-08
Hello,
I have a problem with 3d dimensional dynamic array.How could i set each dimension seperatly.String value

Something 0
Another 0
That 0
Another 1
That 0
procedure TForm1.Button1Click(Sender: TObject);
var
i,j,l:integer;
 multiArray : Array of Array of array of string;
begin
  // Set the length of the 1st dimension of the multi-dim array
  SetLength(multiArray,10);

  // Set the length of the 3 sub-arrays
  SetLength(multiArray[0],5);
  SetLength(multiArray[1],5);
  SetLength(multiArray[2],5);

  SetLength(multiArray[0][0],1);
  SetLength(multiArray[1][1],1);
  SetLength(multiArray[2][2],1);


  // Set elements of this array
  multiarray[0,0,0]:='a'; //<< only sets last dimension
end;

Open in new window

0
Comment
Question by:prasiddutta
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 12

Expert Comment

by:Hypo
ID: 26285289
Could you rephrase your question, or give more examples of what you would like acheive? I really don't understand what you are trying to do... which makes it hard to help...
0
 

Author Comment

by:prasiddutta
ID: 26285351
How could i set each dimension separately string value??
0
 
LVL 23

Expert Comment

by:Ferruccio Accalai
ID: 26285620
Prasiddutta this is not rephrasing but just repeating.
We are not blind, we just need to understand you and honestly is difficult to understand what you are asking for.

In your code what do you mean with the last line?

 multiarray[0,0,0]:='a'; //<< only sets last dimension

'a' is a string, not a value for a dimension...

Any example, as already asked by Hypo?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:prasiddutta
ID: 26290214
I mean how to set value for each dimension like

string value?
0
 
LVL 23

Accepted Solution

by:
Ferruccio Accalai earned 2000 total points
ID: 26291063
Mmm, again repeated the same question in the same way so it's difficult to understand.
as you set each dimension you can set also the values

Let's say that you have a multiarray [x,y,z]
where x, y and z legths are 20

this code will write a different char in every element

var
a,i,j,l: Integer;
begin
a := 97;
for i := 0 to High(MultiArray) do
   for j := 0 to High(Multiarray[i]) do
      for l := 0 to High(MultiArray[j]) do
         begin
            MultiArray[i,j,l] := char(a);
            inc(a);
         end;
end;

0
 

Author Closing Comment

by:prasiddutta
ID: 31675580
Your example is very clear to understand...
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

719 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