home *** CD-ROM | disk | FTP | other *** search
- program DB_Xpl15;
- uses
- CRT,
- DOS,
- GS_KeyI,
- GS_Winfc,
- GS_Date;
-
- var
- KeyinObj : GS_KeyI_Objt;
- CurDateVal,
- WrkDateVal,
- RecDateVal : GS_Date_ValTyp;
- mm,
- dd,
- yy : word;
-
- function Date_Read(x,y : integer; defdate : longint) : GS_Date_ValTyp;
- var
- t : string[10];
- tl : integer;
- okDate : boolean;
- jul : longint;
- begin
- t := GS_Date_View(defdate);
- repeat
- GS_Wind_SetIVMode;
- tl := length(t);
- t := KeyInObj.EditString(t, x, y, tl);
- GS_Wind_SetNmMode;
- gotoxy(x,y); {Go to start of field screen position}
- write(t,'':tl-length(t));
- {Rewrite the string on screen in the original color}
- jul := GS_Date_Juln(t);
- if jul <> GS_Date_JulInv then OkDate := true else OkDate := false;
- if not okDate then SoundBell(BeepTime,BeepFreq);
- until okDate;
- Date_Read := jul;
- end;
-
-
-
-
- begin
- {
- GS_Date_Century := true;
- }
- KeyInObj.Init;
- CurDateVal := GS_Date_Curr;
- ClrScr;
- GoToXY(1,1);
- Write('Current date is: ',GS_Date_View(CurDateVal));
- GoToXY(40,1);
- Write(CurDateVal);
- RecDateVal := 0;
- while RecDateVal <> CurDateVal do
- begin
- ClrScr;
- GoToXY(1,1);
- Write('Enter a date: ');
- RecDateVal := Date_Read(15,1,CurDateVal);
- GoToXY(1,2);
- Writeln('Date in dBase storage format is: ',GS_Date_DBStor(RecDateVal));
- Writeln('Date shown in "view" format is: ',GS_Date_View(RecDateVal));
- Writeln('Days between today and record date = ',
- CurDateVal-RecDateVal:6);
- Writeln('90 days after record date is: ',
- GS_Date_View(RecDateVal+90));
- GS_Date_Jul2MDY(RecDateVal,mm,dd,yy);
- WrkDateVal := GS_Date_MDY2Jul(1,1,yy);
- Writeln('Days since Jan 1 are: ',RecDateVal-WrkDateVal);
- Writeln;
- Writeln('Press any key');
- WaitForKey;
- end;
- end.
-
-