Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

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

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #3  
Antiguo 05-09-2011
juanch_mc juanch_mc is offline
Registrado
 
Registrado: may 2010
Posts: 2
Poder: 0
juanch_mc Va por buen camino
Código Delphi [-]
tiporegdat= record
              clave:tipo_clave;
              id_cuenta:string[10];
              fecha_oper:string[10];
              fecha_asiento:string[10];
              hora_asiento:string[13];
              tipo_op:string[2];
              descripcion:string[25];
              debe:real;
              haber:real;
              saldo:real;
              enlace:tipo_enlace;
             end;

tiporegdatX= record
              clave:tipo_clave;
              id_cuenta:string[10];
              fecha_oper:string[10];
              fecha_asiento:string[10];
              hora_asiento:string[13];
              tipo_op:string[2];
              descripcion:string[25];
              debe:real;
              haber:real;
              saldo:real;
              enlace:tipo_enlace;
             end;

tiporegcontrol= record
                  cont_operac:integer;
                  primero:tipo_pos;
                  ultimo:tipo_pos;
                  borrados:tipo_pos;
                end;

tiporegcontrolX= record
                  cont_operac:integer;
                  primero:tipo_pos;
                  ultimo:tipo_pos;
                  borrados:tipo_pos;
                end;

archdat= file of tiporegdat;
archcontrol= file of tiporegcontrol;
archdatx= file of tiporegdatx;
archcontrolx= file of tiporegcontrolx;

tipo_ME= record
           D:archdat;
           C:archcontrol;
         end;

tipo_MEAUX=record
              DX:archdatx;
              CX:archcontrolx;
            end;

Este es el procedimiento que tengo hasta ahora:

Código Delphi [-]
Procedure Saldos_afecha(var me:tipo_me; var meX:tipo_meaux; fecha:string);
var
  RD, RAUX, R_AUX_2:tiporegdat;
  RC:tiporegcontrol;
  RDAUX:tiporegdatx;
  pos:tipo_pos;
  saldo:real;
  cuenta:string;

  begin
     if (not estructura_vacia(me))
     then
        begin
          seek(me.C,0);
          read(me.C,RC);
          pos:=RC.primero;
          saldo:=0;
          while (pos<>null) do
          begin
              seek(me.D,pos);
              read(me.D,RD);
              if (RD.fecha_oper<=fecha)
              then
                begin
                  cuenta:=RD.id_cuenta;
                  seek(me.D,rd.enlace);
                  read(me.d,RAUX);
                  saldo:=saldo+(rd.haber-rd.debe);
                  if (rd.id_cuenta=RAUX.id_cuenta)
                  then
                    begin
                      while (RD.id_cuenta=RAUX.id_cuenta) do
                        if (RAUX.fecha_oper<=fecha)
                        then
                          begin
                            saldo:=saldo+(RAUX.haber-RAUX.debe);
                            seek(me.D,RAUX.enlace);
                            read(me.D,RAUX);
                          end;
                      RDAUX.id_cuenta:=RD.id_cuenta;
                      RDAUX.saldo:=saldo;
                      insertarX(meX,RDAUX);
                    end
                  else
                    begin
                      RDAUX.id_cuenta:=RD.id_cuenta;
                      RDAUX.saldo:=saldo;
                      insertarX(meX,RDAUX);
                      seek(me.D,RDAUX.enlace);
                      read(me.D,RD);
                    end;
                end //if (RD.fecha_oper<=fecha)
              else
                begin
                   seek(me.D,rd.enlace);
                   read(me.D,RD);
                end;
          end // del while (pos<>null) do
        end //del estructura vacia
     else
       showmessage('LA ESTRUCTURA ESTA VACIA');
  END;
Recién lo termino de tipear, tengo que probarlo, pero se los dejo a ver si alguien le encuentra algún error (seguro hay miles).

Espero que la info que agregue mas arriba sea de ayuda para entenderlo.

Muchas gracias!!!

Última edición por ecfisa fecha: 06-09-2011 a las 10:46:09. Razón: Etiquetas [DELPHI] [/DELPHI]
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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Manejo de Multi-Listas (listas de listas) DelphiRat OOP 4 03-07-2006 19:42:58
Operaciones basiscas listas doblemente enlazadas circulares fede7 Varios 16 07-04-2006 23:15:35
Arreglo y Listas Enlazadas davitcito Varios 14 01-06-2005 16:01:57
Pila con Listas enlazadas (problema con apuntadores) desve Varios 2 30-03-2005 10:07:47
listas doblemente enlazadas Luli OOP 1 19-11-2004 15:41:24


La franja horaria es GMT +2. Ahora son las 23:13:33.


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