Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
IN-WOP
VGEST
Commits
92b20316
Commit
92b20316
authored
Mar 26, 2021
by
Dorchies David
Browse files
feat: remove leap year handling
Fix
#8
parent
4e9527bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/PARAM.PAS
View file @
92b20316
...
...
@@ -832,7 +832,7 @@ procedure Ici_EcritureParametresLacs(var ZFic:text);
write
(
ZFic
,
' '
,
YNomDebit
[
YTypeDebit
],
YRangLac
,
' : '
);
for
XNPivot
:=
1
to
YNbPivot
[
YRangLac
,
YTypeDebit
]
do
begin
write
(
ZFic
,
'si T>= '
,
B_dateclaire
(
2001
,
YQuantPivot
[
YRangLac
,
YTypeDebit
,
XNPivot
]));
write
(
ZFic
,
'si T>= '
,
B_dateclaire
(
YQuantPivot
[
YRangLac
,
YTypeDebit
,
XNPivot
]));
write
(
ZFic
,
' : Q'
,
YRangFormule
[
YRangLac
,
YTypeDebit
,
XNPivot
]);
if
XNPivot
<
YNbPivot
[
YRangLac
,
YTypeDebit
]
then
write
(
ZFic
,
' ; '
);
...
...
src/UTILIT.PAS
View file @
92b20316
...
...
@@ -46,7 +46,7 @@ function B_MinLongInt (ZD1,ZD2:longint):longint;
function
B_MaxDouble
(
ZD1
,
ZD2
:
Bprecis1
)
:
Bprecis1
;
function
B_MinDouble
(
ZD1
,
ZD2
:
Bprecis1
)
:
Bprecis1
;
function
B_Longmois
(
ZMois
:
integer
):
integer
;
function
B_DateClaire
(
ZAnnee
,
ZQuant
:
integer
):
BChai5
;
{date en clair partir du quantieme}
function
B_DateClaire
(
ZQuant
:
integer
):
BChai5
;
{date en clair partir du quantieme}
function
B_Quantieme
(
Zjour
,
Zmois
:
integer
):
integer
;
function
B_QuantiemeNonBiss
(
ZDate
:
longint
):
integer
;
function
B_Tjour
(
ZAn
,
ZMois
,
ZJour
:
longint
):
longint
;
...
...
@@ -102,10 +102,7 @@ function B_MinDouble (ZD1,ZD2:Bprecis1) :Bprecis1;
{----------------------------------------------------------------------------}
function
B_Longmois
(
ZMois
:
integer
):
integer
;
{donne le nombre de jours du mois Mois de l'annee An, en tenant compte pour }
{fvrier du caractre bissextile ou non de l'anne. Une anne est bissextile}
{si elle est multiple de 4 et non divisible par 100, ou bien si elle est }
{multiple de 400. }
{donne le nombre de jours du mois en anne de 365 jours }
var
XL
:
integer
;
begin
B_LongMois
:=
BLong
[
ZMois
];
...
...
@@ -113,7 +110,7 @@ function B_Longmois(ZMois:integer):integer;
{----------------------------------------------------------------------------}
function
B_DateClaire
(
ZAnnee
,
ZQuant
:
integer
):
BChai5
;
function
B_DateClaire
(
ZQuant
:
integer
):
BChai5
;
{---Calcul de la date en format jj.mm partir du quantime annuel, pour ---}
{---anne bissextile ou non. ---}
var
...
...
@@ -161,29 +158,13 @@ function B_QuantiemeNonBiss(ZDate:longint) : integer;
{----------------------------------------------------------------------------}
function
B_Tjour
(
ZAn
,
ZMois
,
ZJour
:
longint
):
longint
;
{calcul du nombre de jours couls depuis le 31
/
12
/1599 (
nombre = 0)
,
--}
{calcul du nombre de jours couls depuis le 01
/
01
/0000 (
nombre = 1)
,
--}
{partir de l'anne, du mois et du jour. le calcul est valable partir --}
{01/01/1600 (nombre = 1). --}
{--obsolte--Calcule le numero du jour compt depuis le 31/12/1899 (1er jour).
An est entr en anne sur 4 chiffres. Le calcul est valable de 1901 2099.
Remarquer que 1900 n'est pas bissextile}
{--obsolte--corrig 2000}
{en anne non bissextiles --}
const
XN
:
array
[
1..12
]
of
integer
=
(
0
,
31
,
59
,
90
,
120
,
151
,
181
,
212
,
243
,
273
,
304
,
334
);
var
XDeb
:
longint
;
begin
ZAn
:=
Zan
-
1600
;
{XDeb:= XN[ZMois]+Zjour+1+ZAn*365+ ((ZAn-1) div 4);}
XDeb
:=
XN
[
ZMois
]+
Zjour
+
ZAn
*
365
+
(
B_maxin
(
0
,
ZAn
-
1
))
div
4
-
(
B_maxin
(
0
,
Zan
-
1
))
div
100
+
(
B_maxin
(
0
,
Zan
-
1
))
div
400
;
if
Zan
>
0
then
XDeb
:=
Xdeb
+
1
;
if
((
ZAn
mod
4
)
=
0
)
and
(
ZMois
>
2
)
then
if
(
((
Zan
mod
100
)<>
0
)
or
((
Zan
mod
400
)=
0
)
)
then
XDeb
:=
XDeb
+
1
;
B_Tjour
:=
XDeb
;
B_Tjour
:=
XN
[
ZMois
]+
Zjour
+
ZAn
*
365
;
end
;
{----------------------------------------------------------------------------}
...
...
src/VGEST.PAS
View file @
92b20316
...
...
@@ -118,7 +118,7 @@ procedure Ici_Effacement;
begin
write
(
YFicSortie
,
'date : '
);
for
Yj
:=(
Yi
-
1
)*
4
+
1
to
B_minin
(
4
*
Yi
,
YNbQXObj
-
1
)
do
write
(
YFicSortie
,
' '
,
B_DateClaire
(
2001
,
YDateObj
[
Yj
]));
write
(
YFicSortie
,
' '
,
B_DateClaire
(
YDateObj
[
Yj
]));
writeln
(
YFicSortie
);
write
(
YFicSortie
,
'debit : '
);
for
Yj
:=(
Yi
-
1
)*
4
+
1
to
B_minin
(
4
*
Yi
,
YNbQXObj
-
1
)
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment