Forum > Beginners

Single deminision arrays(Solved)

<< < (3/4) > >>

MarkMLl:
Also note that declarations such as

--- 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";}};} ---var  South:array[-1..1] of Integer = (10, 32, 41);
generally work as expected.

MarkMLl

SymbolicFrank:
@JLWest: did you check out sets? That might be what you're looking for. The elements can have a numeric value and there are functions to translate between that value and the name. You can have at most 255 elements in a set, but that won't be a problem in this case.

JLWest:
No, I never considered sets. I have a array of records.

winni:
Hi!

Remember that you can avoid the computing of the index if you choose the right range of an array:

--- 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";}};} ---LastCenturyInfo : array[1901..2000] of string;
Winni