Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is this colon for?

Status
Not open for further replies.

JoSno

Programmer
Apr 11, 2003
45
GB
Hi guys,

I'm busily porting some SVS Pascal to run under GPC and the compiler has got very upset at (nearly) this line...

myArray : ARRAY [1..myConst,1:50] OF myType;

Any ideas what that colon does in the second dimension of the array declaration?

This was written in Corel some 20 years ago and was ported automaticaly by a 3rd party converting program about 19 years ago so I have no chance of finding the "author" to ask him!

Cheers!
 

I've no idea about Corel but the statement;

x : ARRAY [1..a,1..b] OF CHAR;

is equivalent to

x : ARRAY [1..a] OF ARRAY[1..b] OF CHAR;

So in your example I guess myArray is a 2 dimensional array with myConst*50 elements.
 
I agree that it is definitely a second dimension for the array, and from the code (if elementAt(array[n,m] < 50)) I can judge that it is something limiting the value that can be held there to a range of maximum 50.

However I'm reluctant to just change it to a range of 1..50 before I know exactly what it was meant to do (this is highly safety related stuff) so I don't end up in jail in a few years for killing anybody!!

The fact that the original author (of the Corel code at least) has made the first dimenstion a range, and the second dimension is very deliberatly not a simple range means I have to look into it some more

Thanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top