[fpc-pascal] Converting code from C++ to FP....

Aleksa Todorovic alexione at gmail.com
Sat Mar 19 08:30:45 CET 2011


On Sat, Mar 19, 2011 at 06:07, Bo Berglund <bo.berglund at gmail.com> wrote:
>
> 1) The second line in the loop contains the command std::max, how can
> that be translated? I have not found any class definition for "std"
> with a method "max"....
>

There is function Max in unit Math, so you could say:

jBegin := Max(k-band, 1);

> 2) The parameter into the function is a pointer *A of type double. To
> me that indicates a value of some kind, but in the code it suddenly
> seems to appear as an array with indexing. What would be the proper
> pascal translation of this?

Indeed. C doesn't actually have difference between pointer to some
data and arrays. You could use open array:

procedure Decompose(var A: array of double);



More information about the fpc-pascal mailing list