decodedate函式的使用資料

2021-04-30 08:25:40 字數 758 閱讀 2093

sysutils

procedure decodedata(date: tdatetime; var year, month, day: word);

decodedate打斷tdatetime成為年月日的值。

decodedate打斷由date引數說明的值成為年月日的值。

如果tdatetime值是小於或等於0,那麼返回的年月日值為0;

這個例子使用乙個按紐和兩個標籤,當按擊按鈕時,當前的日期和時間就會出現在兩個標籤的標題中顯示。

procedure tform1.button1click(sender: tobject);

varpresent: tdatetime;

year, month, day, hour, min, sec, msec: word;

begin

present := now;

decodedate(present, year, hour, day);

label1.caption := 'today is day ' + inttostr(day) + ' of month '+ inttostr(month) + ' of year ' + inttostr(year);

decodetime()present, hour, min, sec, msec);

label2.caption := 'the time is minute ' + inttostr(min) + ' of hour '+ inttostr(hour);

end;

函式的使用

函式的定義 我們有乙個很簡單的函式echoname function echoname 他的結構如下 array type function name echoname property array child array array type echo value array type strin...

函式的使用

1.函式在呼叫時,只看函式名稱,不看引數名稱,至於調完後能不能正常執行,就看你怎麼寫了 function fun1 a,b fun1 1,2 返回值是3 fun1 1,2,3,4 返回值是3 fun1 相當於你定義了乙個變數,沒有給它初始化值,他的預設值是undefined。然後兩個undefine...

函式的使用

函式 完成 特定 功能的 塊,作為乙個整體,對其進行特定的命名,該名字就代表函式 現實中 很多問題要通過一些工具進行處理 可以將工具提前生產出來並命名 通過名字就可以找到工具 使用工具來解決問題 函式的優點 1.避免 的冗餘 2.讓程式 結構更加清晰 3.讓 具有復用性,便於維護 函式的四部分 1....