ashiyr Level: Protégé
 Registered: 05-04-2007 Posts: 5
|
SAVE date in .INI file
kindly help.all i want here is to save the first date so that the next load it will read DATEDIFF then subtract the 1st date and 2nd date. but what happen here it always read the current date so the outcome is always zero(0).how can i save the 1st date without changing it from the current date everytime it loaded so it counts the difference?
file = App.Path & "\Valid.ini"
If sHsUserNameValue = "" Then
lbAppName = "Set"
sHsUserStart = "Start"
sHsUserValue = Date
lpFileName = file
status1 = WritePrivateProfileString(lbAppName, sHsUserStart, sHsUserValue, lpFileName)
End If
If sHsUserValue <> "" Then
stdiff = DateDiff("d", sHsUserValue, Date)
lblAppname = "Set"
sHsDatetext = "Current Date"
sHsDataDate = Date
sHsDateUsed = "TimesUsed"
sHsTimesUsed = stdiff
lpFileName = file
status1 = WritePrivateProfileString(lbAppName, sHsDatetext, sHsDataDate, lpFileName)
status2 = WritePrivateProfileString(lbAppName, sHsDateUsed, sHsTimesUsed, lpFileName)
End If
If sHsTimesUsed >= 10 Then
frmSerial.cmdRead.Enabled = False
End If
|