I didn't see this at first, but for those of you who use High() and Low() in BP can use it in GPC with 2 "work-arounds":
First a BP function (to demonstrate it's use so you understand how the work around functions):
PROCEDURE BPFoo( B : ARRAY OF Integer ); BEGIN WriteLn( 'ARRAY[ ', Low( B ), '..', High( B ), ' ] OF Integer;' ); END;
The 2 GPC work arounds are as follows:
PROCEDURE GPCFooParam( B : ARRAY[ Low..High : Integer ] OF Integer ); BEGIN WriteLn( 'ARRAY[ ', Low, '..', High, ' ] OF Integer;' ); END;
-=[ OR ]=-
FUNCTION GPCHighInt( B : ARRAY[ Low..High : Integer ] OF Integer ): Integer; BEGIN GPCHighInt := High; END;
FUNCTION GPCLowInt( B : ARRAY[ Low..High : Integer ] OF Integer ): Integer; BEGIN GPCLowInt := Low; END;
In the first example of the GPC work around, there's no need for the High()/Low() functions as Low and High already mark the first and last element, respectively. In the second example, it's a work-around that prolly isn't worth it, but another way to do it nonetheless (especially if you need to know the first and last element index from the main program). I don't know if there's a way to do the latter GPC work-around so that it can take an array of any type (I don't know how to do that yet if it's possible), but as far as I know, you need a function for each type you will be using.
Another thing to note is that GPC will return the actual first and last element number, but BP starts it at 0 and ends on the last element. For example, if the index goes from -1 to 4, BP will treat it as 0..6 whereas GPC (and any Standard Pascal compliant Pascal Compiler?) will treat it as -1..4 (don'tcha just LOVE GPC?!?!?!?! :)
See ya! Orlando Llanes
"Meine Damen und Herren, Elvis hat soeben das Gebaeude verlassen!"
"Look out fo' flyeeng feet" O__/ a010111t@bc.seflin.org /|____. O <__. /> / \ ____________|_________ http://ourworld.compuserve.com/homepages/Monkey414