Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   Flash > Delphi (https://www.delphipraxis.net/93360-flash-delphi.html)

endeffects 4. Jun 2007 21:23


Flash > Delphi
 
Hallo,

kann mir vielleicht jemand sagen wie
man folgende flash (action script) methode
in delphi umsetzt?

Delphi-Quellcode:
function decode(key)
{
    var _lc3 = key;
    var _lc1;
    var _lc2 = "";
    for (var _lc1 = _lc3.length - 1; _lc1 >= 0; --_lc1)
    {
        _lc2 = _lc2 + chr(155 - _lc3.charCodeAt(_lc1));
    } 
    return (_lc2);
}

Ghostwalker 4. Jun 2007 21:28

Re: Flash > Delphi
 
Delphi-Quellcode:
  Function Decode(Key:string);
  var
    LC1 : integer;
   
  begin
    result := '';
    for lc1 = length(key) downto 1 do
      result := result+chr(155-ord(key[i]));
  end;
Bitte schön. (ist aber ungetestet aus dem stehgreif gecoded).

endeffects 4. Jun 2007 22:03

Re: Flash > Delphi
 
oh vielen dank, ich hab hier noch eine andere funktion
die ich übersetzen muß, könntest du mir dabei bitte auch noch helfen?


Delphi-Quellcode:
    function decrypt(originalString)
    {
        var _lc2 = "";
        var _lc1;
        var _lc4;
        for (var _lc1 = originalString.length; _lc1 > 0; --_lc1)
        {
            _lc4 = int(_lc1 / 2);
            if (_lc1 % 2 == 0)
            {
                _lc2 = _lc2 + originalString.charAt(_lc1 - 1);
                continue;
            } // end if
            _lc2 = originalString.charAt(_lc1 - 1) + _lc2;
        } // end of for
        if (_lc2.charAt(_lc2.length - 1) == "\t")
        {
            _lc2 = _lc2.substring(0, _lc2.length - 1);
        } // end if
        return (_lc2);
    } // End of the function
hier nochmal die andere kompilierbare funktion

Delphi-Quellcode:
Function Decode(Key:string): String;
  var
    LC1 : integer; s: string;
  begin
    for lc1:= length(key) downto 1 do
      s := s+chr(155-ord(key[lc1]));
    result:= (s);
  end;

Ghostwalker 4. Jun 2007 22:19

Re: Flash > Delphi
 
ok...

Funktion Nr. 2

Delphi-Quellcode:
function decrypt(OrgStr:string):string;
var
  lc1 : integer;
begin
  result := '';
  for lc1 := length(Orgstr) downto 0 do
  begin
    if ((lc1 mod 2) = 0) then
       result := result+Orgstr[lc1-1];
    result := result+orgstr[lc1-1];
  end;
  if (copy(result,length(result)-2,2)='\t') then
    result := copy(result,1,length(result)-2);
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:26 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz