Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #4  
Antiguo 26-10-2003
RedVenom RedVenom is offline
Miembro
 
Registrado: oct 2003
Ubicación: Tabasco, Mexico
Posts: 110
Poder: 23
RedVenom Va por buen camino
Question

hice las siguientes modificaiones al codigo:

[color=red]implementation
{$R *.dfm}
function BaseNADec(num : string; n : byte) : integer;
var
i : integer;
aux : string;
begin
// Solo hasta la 'o' = como máximo base 20... suficiente ¿no?
aux:='0123456789ABCDEF';
result:=0;
for i:=1 to length(num) do result:=result*n+pos(upcase(num[i]),aux)-1;
end;

// De base 16 (hexadecimal) a base 10 (decimal)
function HexADec(num : string) : integer;
begin
result:=BaseNADec(num,16);
end;

// De base 2 (binario) a base 10 (decimal)
function BinADec(num : string) : integer;
begin
result:=BaseNADec(num,2);
end;

// De base 8 (octal) a base 10 (decimal)
function OctADec(num : string) : integer;
begin
result:=BaseNADec(num,8);
end;



procedure TForm1.Button1Click(Sender: TObject);
Var
M:String;
HexADec,BinADec,OctADec:Integer;
begin
if combobox1.Text:= 'Binario' and combobox2.Text:= 'Decimal' then
begin
M:=edit1.text;
BinADec:= StrToInt( '$'+M);
edit2.Text:= IntToStr(BinADec);
else
begin
if combobox1.Text:= 'Hexadecimal' and combobox2.Text:= 'Decimal' then
begin
M:=edit1.text;
HexADec:= StrToInt( '$'+M);
edit2.Text:= IntToStr(HexADec);
end; else
begin
if combobox1.Text:= 'Octal' and combobox2.Text:= 'Decimal' then
begin
M:=edit1.text;
OctADec:= StrToInt( '$'+M);
edit2.Text:= IntToStr(OctADec);
end;
end;
end;
end;COLOR]

Pero me da los siguientes errores:
[Error] Unit1.pas(68): Incompatible types: 'String' and 'procedure, untyped pointer or untyped parameter'
[Error] Unit1.pas(73): ';' not allowed before 'ELSE'



No es que quiera abusar de ustedes pero comprendame soy bastante inexperto con esto pero dos o tres indicaciones y ahi solo.
Gracias
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 01:25:50.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi