Hi,
in VB6 "Format" is a handy function to format date/time strings and numeric strings.
The current implementation in Jabaco is limited to dates and does not really work.
"Timer" is a useful function returning the time since mindnight in seconds.
My current experimental version:
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
Public Function Format(x As Double, fmt As String) As String
Dim df As New java#text#DecimalFormat(fmt)
Format = df.format(x)
End Function
Public Function Format(d As Date, fmt As String) As String
Dim df As New java#text#SimpleDateFormat(fmt)
Format = df.format(d)
End Function
Public Function Timer() As Single
Dim cal As Calendar = java#util#Calendar.getInstance()
Dim hh As Integer = cal.get(java#util#Calendar.HOUR)
Dim mm As Integer = cal.get(java#util#Calendar.MINUTE)
Dim ss As Integer = cal.get(java#util#Calendar.SECOND)
Dim ms As Integer = cal.get(java#util#Calendar.MILLISECOND)
Timer = 0.001 * ms + ss + 60.0 * (mm + 60.0 * hh)
End Function
|
It would be nice, to have a VB6 compliant "Format".
Cheers!
A1880