obum1,
Cita:
Empezado por obum1
...tengo una problema con los inifiles a la hora de que el programa lo lea...no carga todo el string...a un edit...
|
Pregunto:
1- ¿Que versión de
Windows y Delphi utilizas?.
2- ¿El componente TEdit en cuestión,
tiene la propiedad MaxLength con algún valor diferente de cero?.
3- ¿Has hecho un debug
para verificar si los valores son leídos correctamente del archivo .ini?
4- ¿
Puedes publicar el código real que usas en el programa?, el código que publicastes en el
Msg #3 no es el correcto
Revisa este código:
Código Delphi
[-]
procedure TFPrincipal.GuardarINI;
var INI: TIniFile;
begin
INI := TINIFile.Create( ExtractFilePath( Application.ExeName ) + 'opciones.ini' );
INI.WriteString( 'OPCIONES', 'IMPRESORA', IMPRESORA.Text );
INI.WriteInteger( 'OPCIONES', 'COPIAS', COPIAS.Value );
INI.WriteBool( 'OPCIONES', 'VISTAPREVIA', VISTAPREVIA.Checked );
INI.WriteDate( 'OPCIONES', 'FECHA', FECHA.Date );
INI.WriteTime( 'OPCIONES', 'HORA', StrToTime( HORA.Text ) );
INI.WriteFloat( 'OPCIONES', 'MARGEN', MARGEN.Value );
INI.Free;
end;
procedure TFPrincipal.CargarINI;
var INI: TIniFile;
begin
if not FileExists( ExtractFilePath( Application.ExeName ) + 'opciones.ini' ) then
Exit;
INI := TINIFile.Create( ExtractFilePath( Application.ExeName ) + 'opciones.ini' );
IMPRESORA.Text := INI.ReadString( 'OPCIONES', 'IMPRESORA', '' );
COPIAS.Value := INI.ReadInteger( 'OPCIONES', 'COPIAS', 0 );
VISTAPREVIA.Checked := INI.ReadBool( 'OPCIONES', 'VISTAPREVIA', False );
FECHA.Date := INI.ReadDate( 'OPCIONES', 'FECHA', Date );
HORA.Text := TimeToStr( INI.ReadTime( 'OPCIONES', 'HORA', Time ) );
MARGEN.Value := INI.ReadFloat( 'OPCIONES', 'MARGEN', 0.00 );
INI.Free;
end;
Tomado de :
Delphi al Límite - Guardando y cargando opciones
Espero sea útil
Nelson.