![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#4
|
|||
|
|||
|
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 |
|
|
|