?
Solved

Filling a multidimensional array as a constant

Posted on 2008-11-19
3
Medium Priority
?
2,964 Views
Last Modified: 2012-05-11
I have an array MyArray[1..140,1..6] of String, and as all the data is constant I want to hard-wire it as a constant.  What is the syntax for filling the array at design time.  (I know how to do it for one dimension, but not two!)
0
Comment
Question by:jdthedj
  • 2
3 Comments
 
LVL 6

Expert Comment

by:JosephGlosz
ID: 23000559
const
  MyArray: array[1..3,1..2] of string = (('1A','1B'),('2a','2b'),('3a','3b'));

just change the numbers and fill in the data according to the pattern!
0
 
LVL 6

Accepted Solution

by:
JosephGlosz earned 2000 total points
ID: 23000570
Or, perhaps this example makes it even easier:

  MyArray: array[1..3,1..6] of string =
    (('1A','1B','1c','1d','1e','1f'),
     ('2a','2b','2c','2d','2e','2f'),
     ('3a','3b','3c','3d','3e','3f'));
0
 
LVL 3

Author Closing Comment

by:jdthedj
ID: 31518552
Thanks Joseph!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month16 days, 11 hours left to enroll

864 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