Pascal/Turbo Pascal - Calendario

 
Vista:
sin imagen de perfil

Calendario

Publicado por elias (45 intervenciones) el 08/05/2013 00:07:11
Necesito hacer un procedure calendario que me permita mostrar los domingos de un rango de fechas y usar esa información (fecha del domingo ) para otros procedimientos del programa en pascal...¿alguna idea?
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

Calendario

Publicado por ramon (2158 intervenciones) el 16/05/2013 16:32:03
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
program calendario;
uses
   crt, dos;
 type
   dato = record
          hayo : word;
          mese : word;
          dias : word;
          dise :  word;
        end;
 
      fech = array[1..2] of word;
 
   var
     dia, mes, ayo, disem : word;
     fecha : dato;
     cont : integer;
     fh : fech;
 
  procedure guardafecha;
  begin
      getdate(ayo, mes, dia, disem);
      fecha.hayo := ayo;
      fecha.mese := mes;
      fecha.dias := dia;
      fecha.dise := disem;
  end;
 
  procedure ponfechaanterior;
  begin
      setdate(fecha.hayo, fecha.mese, fecha.dias);
  end;
 
  procedure entrafecha(var fh : fech);
  var
    di, ay : word;
    x, y : integer;
  begin
      x := 20;
      y := 2;
      gotoxy(x,y);write('Entre Fecha Mes y A¤o');
      gotoxy(32,y + 1);readln(fh[1]);
      gotoxy(38,y + 1);readln(fh[2]);
  end;
 
  procedure ponfechaconsulta;
  const
     meses : array[1..12] of string[10] = (
     'Enero','Febrero','Marzo','Abril','Mayo','Junio',
     'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre');
  var
    t, di, me, ay, id, ds : word;
    cadi, came : string[2];
    caay : string[4];
    x1, y1, erro : integer;
    salir : boolean;
   begin
      entrafecha(fh);
      guardafecha;
      setdate(fh[2],fh[1],1);
      id := 1;
      salir := false;
      y1 := 7;
      x1 := 20;
      gotoxy(x1 + 3,y1 - 1);write('Los Domingos [',meses[fh[1]],'] Son');
     repeat
     t := id;
     setdate(fh[2],fh[1],t);
     getdate(ay,me,t,ds);
     if ds = 0 then
     x1 := x1 + 4;
     if ds = 0 then
     begin
       textcolor(4);
       gotoxy(x1 - 4,y1 + 1);write(t);
       textcolor(15);
     end;
     id := id + 1;
     until (id > 31) or (salir = true);
     ponfechaanterior;
   end;
 
 
   begin
       clrscr;
       ponfechaconsulta;
       readln;
   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
sin imagen de perfil

Calendario

Publicado por elias (45 intervenciones) el 20/05/2013 16:59:26
Gracias, ahora bien el procedure que necesito implementar va en rango de fechas de agosto a enero, en cada domingo hay un juego de soccer, debo mostrar en "ronda" el domingo que corresponde, se basa en lo siguiente:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
program ful;
  uses
     crt;
 
  var
    k, j, x, y : integer;
  begin
     clrscr;
      for j := 0 to 9 do
      begin
         writeln ('Ronda: k');
         writeln('J = ',j);
       for k := 0 to 9 do
       begin
        write('K = ',k,'   ');
        x := k + j;
        y := 20 - k - 1 + j;
        y := y mod 20;
        writeln(x,'  ',y);
     end;
     readkey;
     clrscr;
    end;
  end.
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