Answer the question
In order to leave comments, you need to log in
Javascript in Delphi?
I'm trying to rewrite js code in delphi
function columnToLetter(column){
var temp, letter = '';
while (column > 0) {
temp = (column - 1) % 26;
letter = String.fromCharCode(temp + 65) + letter;
column = (column - temp - 1) / 26;
}
console.log(letter)
return letter;
}
function TFormMenu.FromCharCode(ch: array of byte): AnsiString;
var
L: Integer;
begin
L := Length(ch);
SetLength(result, L);
if L > 0 then
Move(ch[0], result[1], L);
end;
function TFormMenu.columnToLetter(column: Integer): string;
var
temp: integer;
letter : string;
ch: array[0..500] of byte;
begin
while (column > 0) do
begin
temp := (column - 1) mod 26;
ch[s] := ((temp + 65) + StrToInt(letter));
if inttostr(ch[s]) <> '0' then
letter := letter + FromCharCode(ch[s]);
end;
letter := result;
column := round((column - temp - 1) / 26);
end;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question