Pascal/Turbo Pascal - Crear un programa de recordatorios en PASCAL

 
Vista:
Imágen de perfil de Thalia

Crear un programa de recordatorios en PASCAL

Publicado por Thalia (2 intervenciones) el 07/04/2016 16:49:33
Podrían ayudarme con esto por favor recién estoy empezando a programar con este lenguaje ☺♥
recordatorio
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Crear un programa de recordatorios en PASCAL

Publicado por ramon (2158 intervenciones) el 12/04/2016 13:43:33
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
{A ver si esto te encamina }
 
 program miajenda;
  uses
    crt, dos;
  type
     string10 = string[10];
     string5 = string[5];
     ajenda = record
            hoja : longint;
            fecha : string10;
            acont1 : string;
            hora : string5;
            acont2 : string;
           end;
 
   const
      archivo = 'Ajendas.dat';
 
   var
     f : file of ajenda;
     dato : ajenda;
 
 
   procedure tomadatos(d : ajenda);
   var
      hoj : longint;
   begin
      assign(f,archivo);
    {$I-} reset(f); {$I+}
        if ioresult <> 0 then
        begin
          hoj := 1;
          d.hoja := hoj;
          rewrite(f);
          seek(f,0);
          write(f,d);
          close(f);
        end
     else
        begin
          hoj := filesize(f);
          d.hoja := hoj;
          seek(f,filesize(f));
          write(f,d);
          close(f);
        end;
   end;
 
   procedure entradatos;
   begin
       clrscr;
       writeln('   /// Entrada Datos Ajenda \\\');
       writeln;
       with dato do
       begin
         write('    Entre Fecha dia/mes/a¤o : ');
         readln(fecha);
         write('    Entre Datos 1§          : ');
         readln(acont1);
         write('    Entre Hora hora:min     : ');
         readln(hora);
         write('    Entre datos 2§          : ');
         readln(acont2);
       end;
       tomadatos(dato);
   end;
 
 
   procedure muestradatos;
   var
      ar : longint;
      tt : integer;
   begin
      tt := 1;
      assign(f,archivo);
    {$I-} reset(f); {$I+}
        if ioresult <> 0 then
        begin
          writeln('    Error De Archivo O No Existe Pulse Una Tecla');
          readkey;
        end
     else
        begin
           for ar := 0 to filesize(f) - 1 do
           begin
              seek(f,ar);
              read(f,dato);
              writeln(' ',dato.fecha,'-',dato.acont1,'-',dato.hora,'-',
                           dato.acont2);
              tt := tt + 1;
              if tt > 20 then
              begin
                 writeln;
                 writeln('    Pulse Una Tecla Para Segir');
                 readkey;
                 tt := 1;
                 clrscr;
              end;
           end;
           close(f);
           writeln;
           writeln('    Pulse Una Tecla');
           readkey;
        end;
   end;
 
 
   procedure alarma(fec : string10; hor : string5);
   var
     ar : longint;
     encont : boolean;
   begin
      assign(f,archivo);
    {$I-} reset(f); {$I+}
        if ioresult <> 0 then
        begin
          writeln('    Error De Archivo O No Existe Pulse Una Tecla');
          readkey;
        end
     else
        begin
           encont := false;
           for ar := 0 to filesize(f) - 1 do
           begin
              seek(f,ar);
              read(f,dato);
              if (dato.fecha = fec) and (dato.hora = hor) then
              begin
                 writeln;
                 writeln(' ',dato.fecha,'-',dato.acont1,'-',dato.hora,'-',
                           dato.acont2);
                 close(f);
                 encont := true;
                 writeln;
                 writeln('    Pulse Una Tecla');
                 readkey;
              end;
           end;
             if encont = false then
             begin
                 close(f);
                 writeln;
                 writeln('   Datos No Encontrados');
                 writeln('   Fercha Y Hora = ',fec,'   ',hor);
                 writeln;
                 writeln('    Pulse Una Tecla');
                 readkey;
             end;
        end;
   end;
 
   procedure menu;
   var
     te, tecla : char;
     sal : boolean;
     yo, me, di, dis : word;
     ho, mi, se, ds : word;
     ado : string[4];
     mes, dia : string[2];
     hor, min : string[2];
     fe : string10;
     horas : string5;
    begin
       sal := false;
     repeat
       clrscr;
       writeln('   ***** Menu Jeneral *****');
       writeln;
       writeln('       1 = Entrada Datos');
       writeln('       2 = Mostrar Datos');
       writeln('       3 = Alarma informacion');
       writeln('       4 = Salir');
       writeln;
       writeln('   Elija Una Opcion');
       repeat
           tecla := readkey;
       until tecla in['1','2','3','4'];
       clrscr;
     case tecla of
  '1' : entradatos;
  '2' : muestradatos;
  '3' : begin
          getdate(yo, me, di, dis);
          gettime(ho, mi, se, ds);
          str(yo,ado);
          str(me,mes);
          str(di,dia);
          str(ho,hor);
          str(mi,min);
          fe := dia + '/' + mes + '/' + ado;
          horas := hor + ':' + min;
          writeln('   Busqueda Manual=[M] Automatica=[A]');
          writeln;
          repeat
             te := upcase(readkey);
          until te in['A','M'];
          clrscr;
          if te = 'A' then
          alarma(fe,horas)
        else
           begin
              write('  Entre Fecha dia/mes/a¤o : ');
              readln(fe);
              write('  Entre Hora hora:min : ');
              readln(horas);
              alarma(fe,horas);
           end;
        end;
  '4' : sal := true;
     end;
     until sal = true;
   end;
 
   begin
      menu;
   end.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
1
Comentar
Imágen de perfil de Thalia

Crear un programa de recordatorios en PASCAL

Publicado por Thalia (2 intervenciones) el 13/04/2016 16:23:42
Tengo un error de tipo: Error: Typed files cannot contain reference-counted types. ¿a que se debe esto?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Crear un programa de recordatorios en PASCAL

Publicado por ramon (2158 intervenciones) el 14/04/2016 12:06:49
Dime que pascal estas usando el programa esta con turbo pascal 7.0 bajo windows 7 y funciona bien sin error
pero sino dime el numero de error que te sale.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar