0
I am reprogramming a client system and I need to convert a function in Delphi to PHP to complete a system step and I am struggling with it... could give me a help.. thanks in advance.. follow the code below that needs to be converted to PHP:
Function CalcRegistro(Codigo: String): String;
Var vCod: Extended;
vCnt, vAsc: LongInt;
vStr: String[128];
Begin
vCod:= 0;
vStr:= Copy(Codigo + RepeatStr(' ',128), 1, 128);
For vCnt := 1 to 128 do
Begin
vAsc:= Ord(vStr[vCnt]);
vAsc:= (vAsc + (128-vCnt));
vCod:= vCod + Power(vAsc,6);
End;
Result:= FloatToStrF(vCod, ffFixed, 16, 0);
End;
PHP is basically untyped. A lot of it turns out that it’s not translated into PHP. Have you tried doing anything?
– Jefferson Quesado
The problem is precisely with these functions of Delphi, "Ord" and "Power".. never worked with Delphi...
– Bruno Fumagally
The function that this having difficulty is in
System.Math
, in your example are using basic Delphi functions.– Junior Moreira