Ver Mensaje Individual
  #1  
Antiguo 07-06-2008
mariolop12 mariolop12 is offline
Registrado
 
Registrado: abr 2008
Posts: 5
Reputación: 0
mariolop12 Va por buen camino
Invertir string -

Hola,

Yo uso Delphi 5.
Código Delphi [-]
Estuve buscando por internet como invertir un string.... y encontré el siguiente código

 Function String_Reverse(S : String): String;
Var
   i : Integer;
Begin
   Result := '';
   For i := Length(S) DownTo 1 Do
   Begin
     Result := Result + Copy(S,i,1) ;
   End;
End;

Yo soy muy nuevo en delphi, estoy leyendo y aprendiendo.... 
quisiera saber en qué parte del editor de código puedo introducirlo.

este es mi programa...


interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Buttons;

type
  TForm1 = class(TForm)
    BitBtn1: TBitBtn;
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.BitBtn1Click(Sender: TObject);
VAR a,b,e:real;
r:integer;
begin

a:=strtofloat(inputbox('Datos','Introduzca numero A:',''));
b:=strtofloat(inputbox('Datos','Introduzca numero B:',''));

//parte a   -----------------------------------------------------------
e:=Exp(B*Ln(A));
showmessage('Respuesta:'+' '+floattostr(e));

//parte b   ----------------------------------------------------------
r:=(trunc(Int(A)) mod 4567);

AQUÍ DEBERÍA IR EL CÁLCULO DEL INVERSO DE   'r'

//parte c  ------------------------------------------------------------
ShowMessage('Redondear B a las milésimas:'+FormatFloat('"Value = "0.000', b));

end;

end.


espero puedan ayudarme

Última edición por marcoszorrilla fecha: 07-06-2008 a las 12:54:02. Razón: Etiquetas Delphi
Responder Con Cita