Discussion:
Date problems after installation
(too old to reply)
Pieter van Heerden
2008-12-09 05:47:40 UTC
Permalink
Dates are important in one of my applications. The date format is set in the dBase ini-file and in the application ini-file as 'date=DMY' and to make doubly sure I have also included a line in the set-up program that specifies the date format as DMY.

The problem comes from the following line where dates from two sources are combined to form a new date:

qicrf["plantdate"].value := ctod(str(day(qimp2rf["plantdate"].value),2,0,"0") + "/" + str(month(qimp2rf["plantdate"].value),2,0,"0") + "/" + str(year(qicrf["startdate"].value),4))

When running the application as a program under dBase, the above line always gives the expected date result. After rebuilding the project file, and running the resultant .exe file, this code once again behaves as expected. However, after building an install program and installing it on the same or a different computer this line starts to misbehave. Some dates produced are correct, but more than half show dates far beyond the expected upper limit. I have seen a similar result before when the date month or date day is taken as the year, in other words the date is read the wrong way round. Why would dates be read the wrong way round (if that is the problem((?)) if a date format has been set? Why does the problem only occur in an installed application and not in the origional under dBase? Why are some dates in the column apparently treated correctly and others not?

Please advise.
Rainald
2008-12-09 06:09:43 UTC
Permalink
Post by Pieter van Heerden
Dates are important in one of my applications. The date format is
set in the dBase ini-file and in the application ini-file as
'date=DMY' and to make doubly sure I have also included a line in
the set-up program that specifies the date format as DMY.
The problem comes from the following line where dates from two
qicrf["plantdate"].value :=
ctod(str(day(qimp2rf["plantdate"].value),2,0,"0") + "/" +
str(month(qimp2rf["plantdate"].value),2,0,"0") + "/" +
str(year(qicrf["startdate"].value),4))
This code seems to be one of the most complicated solutions thinkable.

Didn't you check the other most powerful possibilities of the
date-related classes of dB+?

Nothing easier in the dUFLP?

Rainald
Pieter van Heerden
2008-12-10 05:12:44 UTC
Permalink
Post by Rainald
Post by Pieter van Heerden
Dates are important in one of my applications. The date format is
set in the dBase ini-file and in the application ini-file as
'date=DMY' and to make doubly sure I have also included a line in
the set-up program that specifies the date format as DMY.
The problem comes from the following line where dates from two
qicrf["plantdate"].value :=
ctod(str(day(qimp2rf["plantdate"].value),2,0,"0") + "/" +
str(month(qimp2rf["plantdate"].value),2,0,"0") + "/" +
str(year(qicrf["startdate"].value),4))
This code seems to be one of the most complicated solutions thinkable.
Didn't you check the other most powerful possibilities of the
date-related classes of dB+?
Nothing easier in the dUFLP?
Rainald
O, I regularly use date class, and I agree with you as to ease of use and the power of it. However, this still does not answer the question as to why some dates are picked up correctly and others not, and this from the same date columns.
Don
2008-12-10 04:59:36 UTC
Permalink
Post by Pieter van Heerden
Dates are important in one of my applications. The date format is set in the dBase ini-file and in the application ini-file as 'date=DMY' and to make doubly sure I have also included a line in the set-up program that specifies the date format as DMY.
qicrf["plantdate"].value := ctod(str(day(qimp2rf["plantdate"].value),2,0,"0") + "/" + str(month(qimp2rf["plantdate"].value),2,0,"0") + "/" + str(year(qicrf["startdate"].value),4))
Please advise.
Pieter

Are the parenthesis unbalanced?

It looks to me to need one more ")" in each expression.

Don
Pieter van Heerden
2008-12-10 05:23:00 UTC
Permalink
Post by Don
Post by Pieter van Heerden
Dates are important in one of my applications. The date format is set in the dBase ini-file and in the application ini-file as 'date=DMY' and to make doubly sure I have also included a line in the set-up program that specifies the date format as DMY.
qicrf["plantdate"].value := ctod(str(day(qimp2rf["plantdate"].value),2,0,"0") + "/" + str(month(qimp2rf["plantdate"].value),2,0,"0") + "/" + str(year(qicrf["startdate"].value),4))
Please advise.
Pieter
Are the parenthesis unbalanced?
It looks to me to need one more ")" in each expression.
Don
I count the parenthesis right. The basic question is why some dates that were picked up and used by/in that equation, were correct and others not. By the way, using date class functions to build the same result has also not repeated the date errors reported.
Don
2008-12-10 06:07:33 UTC
Permalink
Post by Pieter van Heerden
Dates are important in one of my applications. The date format is set in the dBase ini-file and in the application ini-file as 'date=DMY' and to make doubly sure I have also included a line in the set-up program that specifies the date format as DMY.
qicrf["plantdate"].value := ctod(str(day(qimp2rf["plantdate"].value),2,0,"0") + "/" + str(month(qimp2rf["plantdate"].value),2,0,"0") + "/" + str(year(qicrf["startdate"].value),4))
Please advise.
Me again

Counting again, the 1st expression has ctod,str,day each need 2 parenthesis or total 6, I count 5

The last expression has str, year but 5 parenthesis??

I'm taking qicrf["startdate"].value to be an abbrev for a field value


Don
Continue reading on narkive:
Loading...