Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.65 KB | None | 0 0
  1. treg_esquinas_bin=  record
  2.                 id_esquina: integer;
  3.                 nombre_avenida1: string;
  4.                 nombre_avenida2: string;
  5.                 responsable: string;
  6.                 telefono: string;
  7.                 dir_mail: string;  
  8.                 alta: boolean;             
  9.                 end;
  10. treg_indice_esquinas=   record
  11.                             pocicion: integer;
  12.                             fecha: tfecha;
  13.                             alta: boolean;
  14.                             existe: boolean;
  15.                             end;
  16.                            
  17. tvec_indice_esquinas= array[0..max] of treg_indice_esquinas;   
  18.  
  19. procedure crear_index_esquinas(var cesquinas_bin: arch_esquinas_bin;
  20. var cindice_esquinas: tvec_indice_esquinas; var cmax_logico_indice_esquinas: integer);
  21. var
  22. i,j: integer;
  23. aux_indice_esquinas: treg_indice_esquinas;
  24. aux_esquinas: treg_esquinas_bin;
  25. begin
  26.     reset(cesquinas_bin);
  27.     i:=-1;
  28.     while (not eof(cesquinas_bin)) or (i<> max) do
  29.     begin
  30.         inc(i);
  31.         read(cesquinas_bin,aux_esquinas);
  32.        
  33.         aux_indice_esquinas.pocicion:= i; //carga en el aux la pos
  34.         aux_indice_esquinas.fecha:= aux_esquinas.fecha;//carga en el aux la fecha
  35.        
  36.         if (aux_esquinas.alta) then aux_indice_esquinas.alta := true
  37.         else  aux_indice_esquinas.alta :=false ;    //carga en el aux el estado alta
  38.         aux_indice_esquinas.existe:= true;
  39.         cindice_esquinas[i]:=aux_indice_esquinas;//lo carga en el indice       
  40.     end;
  41.     cmax_logico_indice_esquinas:= i;
  42.     if(i<> max) then //si no llego al final... todo lo restante no existe .. le pongo false para saber su max logico
  43.     for j:= i to max do
  44.     begin
  45.     aux_indice_esquinas.pocicion:= 999;
  46.     aux_indice_esquinas.fecha:= aux_esquinas.fecha;//carga en el aux la fecha
  47.    
  48.     aux_indice_esquinas.alta :=false;
  49.     aux_indice_esquinas.existe:=false;
  50.     cindice_esquinas[j]:=aux_indice_esquinas;//lo carga en el indice
  51.     end;
  52. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement