Forum > Beginners

Single deminision arrays(Solved)

(1/4) > >>

JLWest:
is there a way to declare an static single dimension array as 1 base Say 1..13 as opposed to 0 based 0..12

dsiders:

--- Quote from: JLWest on June 18, 2022, 09:07:47 pm ---is there a way to declare an static single dimension array as 1 base Say 1..13 as opposed to 0 based 0..12

--- End quote ---

Sure. It's covered in the Language reference: https://www.freepascal.org/docs-html/current/ref/refse24.html#x55-750004.4

jamie:

--- Quote from: JLWest on June 18, 2022, 09:07:47 pm ---is there a way to declare an static single dimension array as 1 base Say 1..13 as opposed to 0 based 0..12

--- End quote ---

Static array of what?

--- 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";}};} ---Const A:Array[1..10] of Byte =(1,2,3,4,5,6,7,8,9,10);   You don't specify the data type so I just winged it..

JLWest:
@Jamie
A static array of integers

So the array elements could be 1 ro 52

jamie:
Then just use what I showed and change the type to integer and fill the initial values 1..52 at edit time.

good luck.