hi
i have made a Crossfoot function
now i hope i can explain it good enough for all of you, so you can understand it ;D
Crossfoot is when you take each part(?) of a minimum 2 digit and then you take each part and add them to each other
for example: Crossfoot of: 7364 is 7+3+6+4=20=2+0=2:
Crossfoot of: 7364 is = 2
I hope you all like it and can use it in SRL maybe under math??
Here we go...
SCAR Code:Function Crossfoot(s:String):Integer;
var
PlaceInString, FinalResult, Lengt : Integer;
TempString : String;
Begin
Lengt := Length(s);
repeat
PlaceInString := 0;
FinalResult := 0;
repeat
PlaceInString := PlaceInString+1;
TempString := copy(s, PlaceInString, 1);
FinalResult := StrToInt(TempString)+FinalResult;
Lengt := Lengt-1;
until (Lengt = 0);
Lengt := Length(IntToStr(FinalResult));
s := IntToStr(FinalResult);
until (Lengt = 1);
Result := FinalResult;
End;
Hope it works for you it work for me...
If you find any errors please post it here
\\Batnas


My first script!!!
Reply With Quote





