home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 11
/
BUGCD1998_02.ISO
/
util
/
time2win
/
t2w32500.exe
/
_DATTIM.FRM
< prev
next >
Wrap
Text File
|
1997-12-25
|
36KB
|
811 lines
VERSION 5.00
Object = "{0BA686C6-F7D3-101A-993E-0000C0EF6F5E}#1.0#0"; "THREED32.OCX"
Begin VB.Form frmDateTime
BorderStyle = 4 'Fixed ToolWindow
Caption = "Date & Time"
ClientHeight = 6495
ClientLeft = 1110
ClientTop = 1365
ClientWidth = 7830
MaxButton = 0 'False
MDIChild = -1 'True
PaletteMode = 1 'UseZOrder
ScaleHeight = 6495
ScaleWidth = 7830
ShowInTaskbar = 0 'False
Begin VB.TextBox txt_Result
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
Height = 5325
Left = 120
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 6
Top = 600
Width = 7575
End
Begin Threed.SSPanel SSPanel1
Align = 1 'Align Top
Height = 480
Left = 0
TabIndex = 0
Top = 0
Width = 7830
_Version = 65536
_ExtentX = 13811
_ExtentY = 847
_StockProps = 15
ForeColor = -2147483640
BackColor = 12632256
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Begin VB.ComboBox cmb_Function
Height = 315
Left = 1365
TabIndex = 1
Top = 90
Width = 5145
End
Begin Threed.SSCommand cmdNP
Height = 300
Index = 1
Left = 7500
TabIndex = 5
Top = 90
Width = 255
_Version = 65536
_ExtentX = 450
_ExtentY = 529
_StockProps = 78
Caption = ">"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BevelWidth = 1
Font3D = 3
RoundedCorners = 0 'False
Outline = 0 'False
End
Begin Threed.SSCommand cmdNP
Height = 300
Index = 0
Left = 6660
TabIndex = 4
Top = 90
Width = 255
_Version = 65536
_ExtentX = 450
_ExtentY = 529
_StockProps = 78
Caption = "<"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BevelWidth = 1
Font3D = 3
RoundedCorners = 0 'False
Outline = 0 'False
End
Begin Threed.SSCommand SSCommand1
Default = -1 'True
Height = 300
Left = 6975
TabIndex = 2
Top = 90
Width = 465
_Version = 65536
_ExtentX = 820
_ExtentY = 529
_StockProps = 78
Caption = "&Go"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BevelWidth = 1
RoundedCorners = 0 'False
Outline = 0 'False
End
Begin VB.Label Label2
Caption = "&Select a function"
Height = 255
Left = 90
TabIndex = 3
Top = 120
Width = 1275
End
End
Begin Threed.SSPanel SSPanel2
Align = 2 'Align Bottom
Height = 465
Left = 0
TabIndex = 7
Top = 6030
Width = 7830
_Version = 65536
_ExtentX = 13811
_ExtentY = 820
_StockProps = 15
BackColor = 12632256
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Begin VB.TextBox Text1
Height = 285
Left = 1440
TabIndex = 8
Tag = "A/BC/DEF/GHIJ/KLMNOP/"
Top = 90
Width = 5310
End
Begin Threed.SSCommand SSCommand2
Height = 285
Left = 6885
TabIndex = 9
Top = 90
Width = 825
_Version = 65536
_ExtentX = 1455
_ExtentY = 503
_StockProps = 78
Caption = "&Reset"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BevelWidth = 1
Outline = 0 'False
End
Begin VB.Label Label1
Caption = "&Enter a test value"
Height = 255
Left = 90
TabIndex = 10
Top = 120
Width = 1275
End
End
End
Attribute VB_Name = "frmDateTime"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Option Base 1
Private Const Iteration = 250
Dim IsLoaded As Integer
Dim TimerStartOk As Integer
Dim TimerCloseOk As Integer
Dim TimerHandle As Integer
Dim TimerValue As Long
Private Sub cmdNP_Click(Index As Integer)
Text1.Text = ""
Call sub_NextPrev(cmb_Function, Index)
End Sub
Private Sub cmb_Function_Click()
If (IsLoaded = False) Then Exit Sub
Call cDisableFI(mdiT2W.Picture1)
txt_Result = ""
DoEvents
Select Case cmb_Function.ListIndex
Case 0
Call TestDateStatistic
Case 1
Call TestDateConvert
Case 2
Call TestCnvMinuteToTime
Case 3
Call TestCnvMinuteToHundred
Case 4
Call TestCnvTimeToMinute
Case 5
Call TestCnvHundredToMinute
Case 6
Call TestDateHourLong
End Select
DoEvents
Call cEnableFI(mdiT2W.Picture1)
End Sub
Private Sub Form_Activate()
mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
End Sub
Private Sub Form_Load()
IsLoaded = False
Show
Call sub_Load_Combo(cmb_Function, T2WDirInst + "_dattim.t2w")
IsLoaded = True
End Sub
Private Sub SSCommand1_Click()
Call cmb_Function_Click
End Sub
Private Sub TestDateStatistic()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
Dim nYear As Integer
Dim nMonth As Integer
Dim nDay As Integer
Dim nNow As Long
Dim nIntNow As Integer
If (Trim(Text1.Text) = "") Then Text1.Text = Format$(Now, "dd.mm.yyyy")
nNow = cDateToScalar(Val(Format$(Now, "yyyy")), Val(Format$(Now, "mm")), Val(Format$(Now, "dd")))
Call cScalarToDate(nNow, nYear, nMonth, nDay)
strDisplay = "Today is the '" & Text1.Text & "'" & vbCrLf & vbCrLf
strDisplay = strDisplay & "Day of the week (ISO, U.S., Special) is (" & cDayOfWeek(nYear, nMonth, nDay, True) & ", " & cDayOfWeek(nYear, nMonth, nDay, False) & ", " & cDayOfWeek(nYear, nMonth, nDay, 1) & ") (" & cGetLongDay(LNG_ENGLISH, 1 + cDayOfWeek(nYear, nMonth, nDay, False)) & ")" & vbCrLf
strDisplay = strDisplay & "Day of the year is '" & cDayOfYear(nYear, nMonth, nDay) & "'" & vbCrLf
strDisplay = strDisplay & "Week of the year (ISO, U.S., Special) is (" & cWeekOfYear(nYear, nMonth, nDay, True) & ", " & cWeekOfYear(nYear, nMonth, nDay, False) & ", " & cWeekOfYear(nYear, nMonth, nDay, 1) & ")" & vbCrLf & vbCrLf
nNow = cDateToScalar(nYear, nMonth, nDay)
strDisplay = strDisplay & "Scalar day is '" & nNow & "'" & vbCrLf
Call cScalarToDate(nNow, nYear, nMonth, nDay)
strDisplay = strDisplay & "Year : " & nYear & ", Month : " & nMonth & ", Day : " & nDay & vbCrLf & vbCrLf
nIntNow = cDateToInt(nYear, nMonth, nDay)
strDisplay = strDisplay & "Int day is '" & nIntNow & "'" & vbCrLf
Call cIntToDate(nIntNow, nYear, nMonth, nDay)
strDisplay = strDisplay & "Year : " & nYear & ", Month : " & nMonth & ", Day : " & nDay & vbCrLf & vbCrLf
nNow = Int(Now)
nYear = Year(nNow)
nMonth = 1
nDay = 1
strDisplay = strDisplay & "First Day is the '" & Format$(DateSerial(nYear, nMonth, nDay), "short date") & "'" & vbCrLf & vbCrLf
strDisplay = strDisplay & "Day of the week (ISO, U.S., Special) is (" & cDayOfWeek(nYear, nMonth, nDay, True) & ", " & cDayOfWeek(nYear, nMonth, nDay, False) & ", " & cDayOfWeek(nYear, nMonth, nDay, 1) & ") (" & cGetLongDay(LNG_ENGLISH, 1 + cDayOfWeek(nYear, nMonth, nDay, False)) & ")" & vbCrLf
strDisplay = strDisplay & "Day of the year is '" & cDayOfYear(nYear, nMonth, nDay) & "'" & vbCrLf
strDisplay = strDisplay & "Week of the year (ISO, U.S., Special) is (" & cWeekOfYear(nYear, nMonth, nDay, True) & ", " & cWeekOfYear(nYear, nMonth, nDay, False) & ", " & cWeekOfYear(nYear, nMonth, nDay, 1) & ")" & vbCrLf & vbCrLf
nNow = cDateToScalar(nYear, nMonth, nDay)
strDisplay = strDisplay & "Scalar day is '" & nNow & "'" & vbCrLf
Call cScalarToDate(nNow, nYear, nMonth, nDay)
strDisplay = strDisplay & "Year : " & nYear & ", Month : " & nMonth & ", Day : " & nDay & vbCrLf & vbCrLf
nIntNow = cDateToInt(nYear, nMonth, nDay)
strDisplay = strDisplay & "Int day is '" & nIntNow & "'" & vbCrLf
Call cIntToDate(nIntNow, nYear, nMonth, nDay)
strDisplay = strDisplay & "Year : " & nYear & ", Month : " & nMonth & ", Day : " & nDay & vbCrLf & vbCrLf
txt_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
Call cScalarToDate(nNow, nYear, nMonth, nDay)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestDateConvert()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
Dim Value As String
Dim CurrentDate As String
If (Trim(Text1.Text) = "") Then Text1.Text = Format$(Now, "dd.mm.yyyy")
CurrentDate = Text1.Text
strDisplay = strDisplay & "Current date is " & CurrentDate & vbCrLf & vbCrLf
Value = Val(cConvert(-CNV_DATE_LONG, CurrentDate, intResult))
strDisplay = strDisplay & "Current date in Long Day is " & Value & vbCrLf & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in DATE_LONG is '" & cConvert(CNV_DATE_LONG, Value, intResult) & "'" & vbCrLf & vbCrLf
Value = Val(cConvert(-CNV_DATE_SHORT, CurrentDate, intResult))
strDisplay = strDisplay & "Current date in Short Day is " & Value & vbCrLf & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in DATE_SHORT is '" & cConvert(CNV_DATE_SHORT, Value, intResult) & "'" & vbCrLf & vbCrLf
txt_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
strResult = cConvert(CNV_DATE_SHORT, Value, intResult)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestCnvMinuteToTime()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
Dim Value As String
Dim CurrentTime As String
If (Trim(Text1.Text) = "") Then Text1.Text = Format$(Now, "hh:mm")
CurrentTime = Text1.Text
strDisplay = strDisplay & "Current time is " & CurrentTime & vbCrLf & vbCrLf
Value = Val(cConvert(-CNV_BALANCE_AND_WITH_SIGN, CurrentTime, intResult))
strDisplay = strDisplay & "Current time in minute is " & Value & vbCrLf & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in TIME_FILL_ZERO is '" & cConvert(CNV_TIME_FILL_ZERO, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in TIME is '" & cConvert(CNV_TIME, Value, intResult) & "'" & vbCrLf & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HOUR_FILL_ZERO_AND_WITH_ALWAYS_SIGN is '" & cConvert(CNV_HOUR_FILL_ZERO_AND_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HOUR_FILL_ZERO_AND_WITH_SIGN is '" & cConvert(CNV_HOUR_FILL_ZERO_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HOUR_WITH_ALWAYS_SIGN is '" & cConvert(CNV_HOUR_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HOUR_AND_WITH_SIGN is '" & cConvert(CNV_HOUR_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in BALANCE_FILL_ZERO_AND_WITH_ALWAYS_SIGN is '" & cConvert(CNV_BALANCE_FILL_ZERO_AND_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in BALANCE_FILL_ZERO_AND_WITH_SIGN is '" & cConvert(CNV_BALANCE_FILL_ZERO_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in BALANCE_WITH_ALWAYS_SIGN is '" & cConvert(CNV_BALANCE_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in BALANCE_AND_WITH_SIGN is '" & cConvert(CNV_BALANCE_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf & vbCrLf
Value = "-" & Value
strDisplay = strDisplay & "Convert '" & Value & "' in HOUR_FILL_ZERO_AND_WITH_ALWAYS_SIGN is '" & cConvert(CNV_HOUR_FILL_ZERO_AND_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HOUR_FILL_ZERO_AND_WITH_SIGN is '" & cConvert(CNV_HOUR_FILL_ZERO_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HOUR_WITH_ALWAYS_SIGN is '" & cConvert(CNV_HOUR_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HOUR_AND_WITH_SIGN is '" & cConvert(CNV_HOUR_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in BALANCE_FILL_ZERO_AND_WITH_ALWAYS_SIGN is '" & cConvert(CNV_BALANCE_FILL_ZERO_AND_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in BALANCE_FILL_ZERO_AND_WITH_SIGN is '" & cConvert(CNV_BALANCE_FILL_ZERO_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in BALANCE_WITH_ALWAYS_SIGN is '" & cConvert(CNV_BALANCE_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in BALANCE_AND_WITH_SIGN is '" & cConvert(CNV_BALANCE_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf
txt_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
strResult = cConvert(CNV_TIME, Value, intResult)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestCnvMinuteToHundred()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
Dim Value As String
Dim CurrentTime As String
If (Trim(Text1.Text) = "") Then Text1.Text = Format$(Now, "hh:mm")
CurrentTime = Text1.Text
strDisplay = strDisplay & "Current time is " & CurrentTime & vbCrLf & vbCrLf
Value = Val(cConvert(-CNV_BALANCE_AND_WITH_SIGN, CurrentTime, intResult))
strDisplay = strDisplay & "Current time in minute is " & Value & vbCrLf & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_TIME_FILL_ZERO is '" & cConvert(CNV_HUNDRED_TIME_FILL_ZERO, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_TIME is '" & cConvert(CNV_HUNDRED_TIME, Value, intResult) & "'" & vbCrLf & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_HOUR_FILL_ZERO_AND_WITH_ALWAYS_SIGN is '" & cConvert(CNV_HUNDRED_HOUR_FILL_ZERO_AND_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_HOUR_FILL_ZERO_AND_WITH_SIGN is '" & cConvert(CNV_HUNDRED_HOUR_FILL_ZERO_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_HOUR_WITH_ALWAYS_SIGN is '" & cConvert(CNV_HUNDRED_HOUR_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_HOUR_AND_WITH_SIGN is '" & cConvert(CNV_HUNDRED_HOUR_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_BALANCE_FILL_ZERO_AND_WITH_ALWAYS_SIGN is '" & cConvert(CNV_HUNDRED_BALANCE_FILL_ZERO_AND_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_BALANCE_FILL_ZERO_AND_WITH_SIGN is '" & cConvert(CNV_HUNDRED_BALANCE_FILL_ZERO_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_BALANCE_WITH_ALWAYS_SIGN is '" & cConvert(CNV_HUNDRED_BALANCE_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_BALANCE_AND_WITH_SIGN is '" & cConvert(CNV_HUNDRED_BALANCE_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf & vbCrLf
Value = "-" & Value
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_HOUR_FILL_ZERO_AND_WITH_ALWAYS_SIGN is '" & cConvert(CNV_HUNDRED_HOUR_FILL_ZERO_AND_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_HOUR_FILL_ZERO_AND_WITH_SIGN is '" & cConvert(CNV_HUNDRED_HOUR_FILL_ZERO_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_HOUR_WITH_ALWAYS_SIGN is '" & cConvert(CNV_HUNDRED_HOUR_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_HOUR_AND_WITH_SIGN is '" & cConvert(CNV_HUNDRED_HOUR_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_BALANCE_FILL_ZERO_AND_WITH_ALWAYS_SIGN is '" & cConvert(CNV_HUNDRED_BALANCE_FILL_ZERO_AND_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_BALANCE_FILL_ZERO_AND_WITH_SIGN is '" & cConvert(CNV_HUNDRED_BALANCE_FILL_ZERO_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_BALANCE_WITH_ALWAYS_SIGN is '" & cConvert(CNV_HUNDRED_BALANCE_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_BALANCE_AND_WITH_SIGN is '" & cConvert(CNV_HUNDRED_BALANCE_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf
txt_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
strResult = cConvert(CNV_HUNDRED_TIME, Value, intResult)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestCnvTimeToMinute()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
Dim Value As String
Dim CurrentTime As String
If (Trim(Text1.Text) = "") Then Text1.Text = Val(cConvert(-CNV_BALANCE_AND_WITH_SIGN, Format$(Now, "hh:mm"), intResult))
CurrentTime = Text1.Text
strDisplay = strDisplay & "Current minute is " & CurrentTime & vbCrLf & vbCrLf
Value = cCompress(cConvert(CNV_BALANCE_AND_WITH_SIGN, CurrentTime, intResult))
strDisplay = strDisplay & "Current minute in time is " & Value & vbCrLf & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in TIME_FILL_ZERO is '" & cConvert(-CNV_TIME_FILL_ZERO, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in TIME is '" & cConvert(-CNV_TIME, Value, intResult) & "'" & vbCrLf & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HOUR_FILL_ZERO_AND_WITH_ALWAYS_SIGN is '" & cConvert(-CNV_HOUR_FILL_ZERO_AND_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HOUR_FILL_ZERO_AND_WITH_SIGN is '" & cConvert(-CNV_HOUR_FILL_ZERO_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HOUR_WITH_ALWAYS_SIGN is '" & cConvert(-CNV_HOUR_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HOUR_AND_WITH_SIGN is '" & cConvert(-CNV_HOUR_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in BALANCE_FILL_ZERO_AND_WITH_ALWAYS_SIGN is '" & cConvert(-CNV_BALANCE_FILL_ZERO_AND_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in BALANCE_FILL_ZERO_AND_WITH_SIGN is '" & cConvert(-CNV_BALANCE_FILL_ZERO_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in BALANCE_WITH_ALWAYS_SIGN is '" & cConvert(-CNV_BALANCE_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in BALANCE_AND_WITH_SIGN is '" & cConvert(-CNV_BALANCE_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf & vbCrLf
Value = "-" & Value
strDisplay = strDisplay & "Convert '" & Value & "' in HOUR_FILL_ZERO_AND_WITH_ALWAYS_SIGN is '" & cConvert(-CNV_HOUR_FILL_ZERO_AND_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HOUR_FILL_ZERO_AND_WITH_SIGN is '" & cConvert(-CNV_HOUR_FILL_ZERO_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HOUR_WITH_ALWAYS_SIGN is '" & cConvert(-CNV_HOUR_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HOUR_AND_WITH_SIGN is '" & cConvert(-CNV_HOUR_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in BALANCE_FILL_ZERO_AND_WITH_ALWAYS_SIGN is '" & cConvert(-CNV_BALANCE_FILL_ZERO_AND_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in BALANCE_FILL_ZERO_AND_WITH_SIGN is '" & cConvert(-CNV_BALANCE_FILL_ZERO_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in BALANCE_WITH_ALWAYS_SIGN is '" & cConvert(-CNV_BALANCE_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in BALANCE_AND_WITH_SIGN is '" & cConvert(-CNV_BALANCE_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf
txt_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
strResult = cConvert(-CNV_TIME, Value, intResult)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestCnvHundredToMinute()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
Dim Value As String
Dim CurrentTime As String
If (Trim(Text1.Text) = "") Then Text1.Text = Val(cConvert(-CNV_BALANCE_AND_WITH_SIGN, Format$(Now, "hh:mm"), intResult))
CurrentTime = Text1.Text
strDisplay = strDisplay & "Current time is " & CurrentTime & vbCrLf & vbCrLf
Value = cCompress(cConvert(CNV_HUNDRED_BALANCE_AND_WITH_SIGN, CurrentTime, intResult))
strDisplay = strDisplay & "Current minute in time is " & Value & vbCrLf & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_TIME_FILL_ZERO is '" & cConvert(-CNV_HUNDRED_TIME_FILL_ZERO, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_TIME is '" & cConvert(-CNV_HUNDRED_TIME, Value, intResult) & "'" & vbCrLf & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_HOUR_FILL_ZERO_AND_WITH_ALWAYS_SIGN is '" & cConvert(-CNV_HUNDRED_HOUR_FILL_ZERO_AND_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_HOUR_FILL_ZERO_AND_WITH_SIGN is '" & cConvert(-CNV_HUNDRED_HOUR_FILL_ZERO_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_HOUR_WITH_ALWAYS_SIGN is '" & cConvert(-CNV_HUNDRED_HOUR_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_HOUR_AND_WITH_SIGN is '" & cConvert(-CNV_HUNDRED_HOUR_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_BALANCE_FILL_ZERO_AND_WITH_ALWAYS_SIGN is '" & cConvert(-CNV_HUNDRED_BALANCE_FILL_ZERO_AND_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_BALANCE_FILL_ZERO_AND_WITH_SIGN is '" & cConvert(-CNV_HUNDRED_BALANCE_FILL_ZERO_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_BALANCE_WITH_ALWAYS_SIGN is '" & cConvert(-CNV_HUNDRED_BALANCE_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_BALANCE_AND_WITH_SIGN is '" & cConvert(-CNV_HUNDRED_BALANCE_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf & vbCrLf
Value = "-" & Value
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_HOUR_FILL_ZERO_AND_WITH_ALWAYS_SIGN is '" & cConvert(-CNV_HUNDRED_HOUR_FILL_ZERO_AND_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_HOUR_FILL_ZERO_AND_WITH_SIGN is '" & cConvert(-CNV_HUNDRED_HOUR_FILL_ZERO_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_HOUR_WITH_ALWAYS_SIGN is '" & cConvert(-CNV_HUNDRED_HOUR_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_HOUR_AND_WITH_SIGN is '" & cConvert(-CNV_HUNDRED_HOUR_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_BALANCE_FILL_ZERO_AND_WITH_ALWAYS_SIGN is '" & cConvert(-CNV_HUNDRED_BALANCE_FILL_ZERO_AND_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_BALANCE_FILL_ZERO_AND_WITH_SIGN is '" & cConvert(-CNV_HUNDRED_BALANCE_FILL_ZERO_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_BALANCE_WITH_ALWAYS_SIGN is '" & cConvert(-CNV_HUNDRED_BALANCE_WITH_ALWAYS_SIGN, Value, intResult) & "'" & vbCrLf
strDisplay = strDisplay & "Convert '" & Value & "' in HUNDRED_BALANCE_AND_WITH_SIGN is '" & cConvert(-CNV_HUNDRED_BALANCE_AND_WITH_SIGN, Value, intResult) & "'" & vbCrLf
txt_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
strResult = cConvert(-CNV_TIME, Value, intResult)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub SSCommand2_Click()
Dim intResult As Integer
Select Case cmb_Function.ListIndex
Case 0 'TestDateStatistic
Text1.Text = Format$(Now, "dd.mm.yyyy")
Case 1 'TestDateConvert
Text1.Text = Format$(Now, "dd.mm.yyyy")
Case 2 'TestCnvMinuteToTime
Text1.Text = Format$(Now, "hh:mm")
Case 3 'TestCnvMinuteToHundred
Text1.Text = Format$(Now, "hh:mm")
Case 4 'TestCnvTimeToMinute
Text1.Text = Val(cConvert(-CNV_BALANCE_AND_WITH_SIGN, Format$(Now, "hh:mm"), intResult))
Case 5 'TestCnvHundredToMinute
Text1.Text = Val(cConvert(-CNV_HUNDRED_BALANCE_AND_WITH_SIGN, Format$(Now, "hh:mm"), intResult))
Case 6 'TestDateHourLong
Text1.Text = Format$(Now, "dd.mm.yyyy hh:nn:ss")
End Select
End Sub
Private Sub TestDateHourLong()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
Dim nYear As Integer
Dim nMonth As Integer
Dim nDay As Integer
Dim nHour As Integer
Dim nMinute As Integer
Dim nExtra As Integer
Dim nNow As Long
Dim fNow As Date
fNow = Now
Text1.Text = Format$(fNow, "dd.mm.yyyy hh:nn:ss")
strDisplay = "Today is the '" & Text1.Text & "'" & vbCrLf & vbCrLf
nYear = Val(Format$(fNow, "yyyy"))
nMonth = Val(Format$(fNow, "mm"))
nDay = Val(Format$(fNow, "dd"))
nHour = Val(Format$(fNow, "hh"))
nMinute = Val(Format$(fNow, "nn"))
nExtra = Val(Format$(fNow, "ss")) \ 2
nNow = cDateHourToLong(nYear, nMonth, nDay, nHour, nMinute, nExtra)
strDisplay = strDisplay & "Actual DateHour is '" & nNow & "'" & vbCrLf
Call cLongToDateHour(nNow, nYear, nMonth, nDay, nHour, nMinute, nExtra)
strDisplay = strDisplay & "Year : " & nYear & ", Month : " & nMonth & ", Day : " & nDay & vbCrLf
strDisplay = strDisplay & "Hour : " & nHour & ", Minute : " & nMinute & ", Extra : " & nExtra & vbCrLf & vbCrLf
nYear = Val(Format$(Now, "yyyy"))
nMonth = 1
nDay = 1
nHour = 0
nMinute = 0
nExtra = 0
strDisplay = strDisplay & "First Day is the '" & Format$(DateSerial(nYear, nMonth, nDay), "short date") & " 00:00:00'" & vbCrLf & vbCrLf
nNow = cDateHourToLong(nYear, nMonth, nDay, nHour, nMinute, nExtra)
strDisplay = strDisplay & "Actual DateHour is '" & nNow & "'" & vbCrLf
Call cLongToDateHour(nNow, nYear, nMonth, nDay, nHour, nMinute, nExtra)
strDisplay = strDisplay & "Year : " & nYear & ", Month : " & nMonth & ", Day : " & nDay & vbCrLf
strDisplay = strDisplay & "Hour : " & nHour & ", Minute : " & nMinute & ", Extra : " & nExtra & vbCrLf & vbCrLf
nYear = 1900
nMonth = 1
nDay = 1
nHour = 0
nMinute = 0
nExtra = 0
strDisplay = strDisplay & "Minimum DateHour '1900.01.01 00:00'" & vbCrLf & vbCrLf
nNow = cDateHourToLong(nYear, nMonth, nDay, nHour, nMinute, nExtra)
strDisplay = strDisplay & "Actual DateHour is '" & nNow & "'" & vbCrLf
Call cLongToDateHour(nNow, nYear, nMonth, nDay, nHour, nMinute, nExtra)
strDisplay = strDisplay & "Year : " & nYear & ", Month : " & nMonth & ", Day : " & nDay & vbCrLf
strDisplay = strDisplay & "Hour : " & nHour & ", Minute : " & nMinute & ", Extra : " & nExtra & vbCrLf & vbCrLf
nYear = 1900 + 179
nMonth = 6
nDay = 6
nHour = 23
nMinute = 59
nExtra = 31
strDisplay = strDisplay & "Maximum DateHour '2079.06.06 23:59'" & vbCrLf & vbCrLf
nNow = cDateHourToLong(nYear, nMonth, nDay, nHour, nMinute, nExtra)
strDisplay = strDisplay & "Actual DateHour is '" & nNow & "'" & vbCrLf
Call cLongToDateHour(nNow, nYear, nMonth, nDay, nHour, nMinute, nExtra)
strDisplay = strDisplay & "Year : " & nYear & ", Month : " & nMonth & ", Day : " & nDay & vbCrLf
strDisplay = strDisplay & "Hour : " & nHour & ", Minute : " & nMinute & ", Extra : " & nExtra & vbCrLf & vbCrLf
nYear = 1997
nMonth = 1
nDay = 1
nHour = 23
nMinute = 59
nExtra = 31
strDisplay = strDisplay & "Test DateHour '1997-01-01 23:59:31'" & vbCrLf & vbCrLf
nNow = cDateHourToLong(nYear, nMonth, nDay, nHour, nMinute, nExtra)
strDisplay = strDisplay & "Actual DateHour is '" & nNow & "'" & vbCrLf
Call cLongToDateHour(nNow, nYear, nMonth, nDay, nHour, nMinute, nExtra)
strDisplay = strDisplay & "Year : " & nYear & ", Month : " & nMonth & ", Day : " & nDay & vbCrLf
strDisplay = strDisplay & "Hour : " & nHour & ", Minute : " & nMinute & ", Extra : " & nExtra & vbCrLf & vbCrLf
txt_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
Call cLongToDateHour(nNow, nYear, nMonth, nDay, nHour, nMinute, nExtra)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub