Forum > Beginners

Initializing ​multi-dimensional array at the declarition time [SOLVED]

(1/1)

pascal111:
في السطر التالي من كود أحد البرامج وجدتُّ شحناً للمصفوفة أثناء عمليّة الإعلان عنها ولكنّ هذه المصفوفة ذات بعدٍ واحد ،فماذا لو كانت المصفوفة مُتعددة الأبعاد فكيف يُمكن شحنها بقيم أوليّة عند بدء الإعلان عنها في قسم المتغيرات.

"In the next line of the code of one of the programs, I found a shipping "initializing" for the matrix during the process of announcing "declaring" it, but this matrix is ​​one-dimensional, so what if the matrix is ​​multi-dimensional, how can it be charged with initial values ​​when it is announced "declared" in the variables section."

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---INTERVALS: array[0..5] of Integer = (1000, 300, 100, 40, 20, 10);

lucamar:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  INTERVALS: array[0..5, 0..1] of Integer =    { It's equivalent to array[0..5] of array[0..1], so:}    ((1000, 0), (300, 1),     ( 100, 2),  (40, 3),     (  20, 4),  (10, 5));

pascal111:
Thanks, I got the idea now.