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
  #5  
Antiguo 28-12-2005
[Gunman] [Gunman] is offline
Miembro
 
Registrado: dic 2004
Ubicación: Pedreguer.
Posts: 355
Poder: 22
[Gunman] Va por buen camino
Yo te aconsejo que uses archivos .ini (puedes combinalos con archivos .txt) si hay más de una persona. Un ejemplo tipo agenda:
Archivo lista.ini:
=============
[Pepe]
Apellido='Botella'
Edad=69
Notas='./pepe_botella.txt'
[Jose]
Apellido='Ansar'
Edad=96
Notas='./jose_ansar.txt'
=============

Archivo pepe_botella.txt:
=================================
No hem volem cap, que no estigas borratxo!
=================================

Archivo jose_ansar.txt:
=================================
España va bien!
=================================

Código Delphi [-]
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    ListBox1: TListBox;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Memo1: TMemo;
    procedure FormCreate(Sender: TObject);
    procedure ListBox1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var
  Lista: TIniFile;
begin
  Lista := TIniFile.Create('.\lista.ini');
  try
    Lista.ReadSections(ListBox1.Items);
  finally
    Lista.Free;
  end;
end;

procedure TForm1.ListBox1Click(Sender: TObject);
var
  Lista: TIniFile;
begin
  if ListBox1.ItemIndex >= 0 then
  Lista := TIniFile.Create('.\lista.ini');
  try
    Edit1.Text := ListBox1.Items.Strings[ListBox1.ItemIndex];
    Edit2.Text := Lista.ReadString(ListBox1.Items.Strings[ListBox1.ItemIndex],'Apellido', '');
    Edit3.Text := IntToStr(Lista.ReadInteger(ListBox1.Items.Strings[ListBox1.ItemIndex],'Edad', 0));
    Memo1.Lines.LoadFromFile(Lista.ReadString(ListBox1.Items.Strings[ListBox1.ItemIndex], 'Notas', './'+Edit1.Text+'_'+Edit2.Text+'.txt'));
  finally
    Lista.Free;
  end;
end;

end.

Tu ya te lo adaptas a tu gusto...
__________________
l2prog.co.nr
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 10:24:32.


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