สวัสดีครับ เรามีวิธีการอ่าน system time เก็บเข้า structure ได้ไม่ยากครับ เริ่มแรกก็ให้ทำการกำหนด Global External Function ก่อนครับ
SUBROUTINE GetSystemTime(ref systemtime systimeptr) Library "Kernel32.dll"
จากนั้นก็ทำการสร้าง structure โดยมีโครงสร้างดังนี้ครับ
uint year, uint month, uint dayofweek, uint day, uint hour, uint minute, uint second, uint millisecond
เก็บใว้ในชื่อว่า systemtime
จากนั้นก็ลงมือเขียนสคริปต์กันเลยนะครับ
systemtime s_systime
string l_day, l_date, l_time
GetSystemTime(s_systime)
l_date = string(s_systime.month) +"/"+ string(s_systime.day)+"/"+ string(s_systime.year)
l_time = string(s_systime.hour) +":"+ string(s_systime.minute)+":"+ string(s_systime.second)& +":"+string(s_systime.millisecond)
CHOOSE CASE s_systime.dayofweek
CASE 1
l_day = "Sunday"
CASE 2
l_day = "Monday"
CASE 3
l_day = "Tuesday"
CASE 4
l_day = "Wednesday"
CASE 5
l_day = "Thursday"
CASE 6
l_day = "Friday"
CASE 7
l_day = "Saturday"
END CHOOSE
การอ่าน system time เก็บเข้า structure
Latest News
- บทที่ 7-1 ตอน การสร้างระบบฐานข้อมูล
- บทที่ 6 ทดลองเขียนโปรแกรมด้วย PocketBuilder เบื้องต้น
- บทที่ 4 ติดตั้งdatabase sql anywhere
- บทที่ 7-2 ตอน การสร้างโปรแกรมแสดงรายการอาหารที่สั่ง ด้วย Powerbuilder 9
- บทที่ 3 ติดตั้งอุปกรณ์ และโปรแกรม Active Sync
- ทำชุด setup โปรแกรมด้วย Wise Install
- การติดตั้ง IIS
- ตัวอย่าง code โปรแกรมร้านเช่า VDO
- สมาชิก : 2
- Content : 336
- เว็บลิงก์ : 8
- จำนวนครั้งเปิดดูบทความ : 159015


