1. TEditBox의 OnChange Event를 이용하시면 됩니다..
총금액이 표시되는 것이.. edTotal이라면
Procedure Form1.edTotalOnChange(Sender:TObject);
Begin
Try
edVAT.Text:= IntToStr(StrToInt(edTotal.Text) Div 10);
Except
edVAT.Text:= '';
End;
End;
2. 날짜 계산은 Turbo Pascal 때 짠 소스라..
올리고 싶지는 않지만.. 급하신거 같아서 올립니다..
흉하지는 마시기 바랍니다..
Type
Date_Rec = Record
Year, Month, Day, Chack : Integer;
End;
Function DayOfMonth(Year,Month:Integer):Integer;
Begin
Case Month Of
1, 3, 5, 7, 8,10,12 : DayOfMonth:=31;
4, 6, 9,11 : DayOfMonth:=30;
2 : If DayOfYear(Year) = 365 then DayOfMonth:=28
Else DayOfMonth:=29;
End;
End;
Procedure IncMonth(Var Date:Date_Rec; Gap:Integer);
Begin
With Date do
Begin
Month:= Month + Gap;
Year:= Year + ((Month-1) Div 12);
Month:= ((Month-1) Mod 12) + 1;
End;
End;
Procedure IncDay(Var Date:Date_Rec; Gap:Integer);
Var
TempInt : Integer;
Begin
TempInt:= Gap;
While TempInt > DayOfMonth(Date.Year, Date.Month) do
Begin
TempInt:= TempInt - DayOfMonth(Date.Year, Date.Month);
IncMonth(Date, 1);
End;
Date.Day:= Date.Day + TempInt;
If Date.Day > DayOfMonth(Date.Year, Date.Month) then
Begin
Date.Day:= Date.Day - DayOfMonth(Date.Year, Date.Month);
IncMonth(Date, 1);
End;
End;
From 류..
|