home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form ReadDate
- Caption = "Read Date"
- ClientHeight = 2115
- ClientLeft = 1140
- ClientTop = 1470
- ClientWidth = 3690
- LinkTopic = "PlayWave"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 2115
- ScaleWidth = 3690
- Begin VB.CommandButton Play
- Caption = "Today's Date"
- Height = 420
- Left = 1725
- TabIndex = 0
- Top = 1545
- Width = 1905
- End
- Begin VB.Label Label1
- Caption = "Label1"
- Height = 270
- Left = 480
- TabIndex = 1
- Top = 240
- Width = 2385
- End
- Attribute VB_Name = "ReadDate"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private Declare Function mciSendStringA Lib "WinMM" _
- (ByVal mciCommand As String, ByVal returnStr As String, _
- ByVal returnLength As Integer, ByVal callBack As Integer) As Long
- Private Declare Function mciGetErrorStringA Lib "WinMM" _
- (ByVal error As Long, ByVal buffer As String, _
- ByVal length As Integer) As Integer
-
- Private Sub Form_Load()
- Dim curDate
- Dim myStr
- 'Get Date
- curDate = Date
- myStr = Format(curDate, "dddd mmm, dd yyyy")
- Label1.Caption = myStr
- End Sub
- Private Sub Play_Click()
- Dim errorCode As Integer
- Dim returnStr As Integer
- Dim returnCode As Integer
- Dim errorStr As String * 256
- Dim curDate
- Dim myStr
- Dim myDay As String * 256
- errorCode = mciSendStringA("open days.wav type waveaudio alias days", _
- returnStr, 255, 0)
- errorCode = mciSendStringA("open months.wav type waveaudio alias months", _
- returnStr, 255, 0)
- errorCode = mciSendStringA("open years.wav type waveaudio alias years", _
- returnStr, 255, 0)
- returnCode = mciGetErrorStringA(errorCode, errorStr, 255)
- 'Get Date
- curDate = Date
- 'Get Day
- myStr = Format(curDate, "dddd")
- If myStr = "Sunday" Then
- errorCode = mciSendStringA("play days from 6000 to 7000 wait", returnStr, 255, 0)
- ElseIf myStr = "Monday" Then
- errorCode = mciSendStringA("play days from 0 to 1000 wait", returnStr, 255, 0)
- ElseIf myStr = "Tuesday" Then
- errorCode = mciSendStringA("play days from 1000 to 2000 wait", returnStr, 255, 0)
- ElseIf myStr = "Wednesday" Then
- errorCode = mciSendStringA("play days from 2000 to 3000 wait", returnStr, 255, 0)
- ElseIf myStr = "Thursday" Then
- errorCode = mciSendStringA("play days from 3000 to 4000 wait", returnStr, 255, 0)
- ElseIf myStr = "Friday" Then
- errorCode = mciSendStringA("play days from 4000 to 5000 wait", returnStr, 255, 0)
- ElseIf myStr = "Saturday" Then
- errorCode = mciSendStringA("play days from 5000 to 6000 wait", returnStr, 255, 0)
- End If
- 'Get Month
- myStr = Format(curDate, "mmm")
- If myStr = "Jan" Then
- errorCode = mciSendStringA("play months from 500 to 1300 wait", returnStr, 255, 0)
- ElseIf myStr = "Feb" Then
- errorCode = mciSendStringA("play months from 1500 to 2300 wait", returnStr, 255, 0)
- ElseIf myStr = "Mar" Then
- errorCode = mciSendStringA("play months from 2500 to 3100 wait", returnStr, 255, 0)
- ElseIf myStr = "Apr" Then
- errorCode = mciSendStringA("play months from 3400 to 4300 wait", returnStr, 255, 0)
- ElseIf myStr = "May" Then
- errorCode = mciSendStringA("play months from 4500 to 5300 wait", returnStr, 255, 0)
- ElseIf myStr = "Jun" Then
- errorCode = mciSendStringA("play months from 5500 to 6300 wait", returnStr, 255, 0)
- ElseIf myStr = "Jul" Then
- errorCode = mciSendStringA("play months from 6500 to 7100 wait", returnStr, 255, 0)
- ElseIf myStr = "Aug" Then
- errorCode = mciSendStringA("play months from 7500 to 8200 wait", returnStr, 255, 0)
- ElseIf myStr = "Sep" Then
- errorCode = mciSendStringA("play months from 8400 to 9200 wait", returnStr, 255, 0)
- ElseIf myStr = "Oct" Then
- errorCode = mciSendStringA("play months from 9400 to 10200 wait", returnStr, 255, 0)
- ElseIf myStr = "Nov" Then
- errorCode = mciSendStringA("play months from 10500 to 11200 wait", returnStr, 255, 0)
- ElseIf myStr = "Dec" Then
- errorCode = mciSendStringA("play months from 11200 to 12000 wait", returnStr, 255, 0)
- End If
- 'Get Year
- myStr = Format(curDate, "yyyy")
- If myStr = "1996" Then
- errorCode = mciSendStringA("play years from 4000 to 5500 wait", returnStr, 255, 0)
- ElseIf myStr = "1997" Then
- errorCode = mciSendStringA("play years from 5500 to 7500 wait", returnStr, 255, 0)
- ElseIf myStr = "1998" Then
- errorCode = mciSendStringA("play years from 7500 to 9000 wait", returnStr, 255, 0)
- ElseIf myStr = "1999" Then
- errorCode = mciSendStringA("play years from 9000 to 10500 wait", returnStr, 255, 0)
- End If
-
- End Sub
-