|
Post by frankmazz on Jan 29, 2021 6:03:34 GMT 1
I recently discovered a repeatable error running dBASE IV v1.5 in vDOS (2018-05-01) and I'm wondering if it is related the the vDOS version I'm using (running in latest Windows 10 Home)
dBASE is returning incorrect values in some math functions. The error seems to occur when dealing with powers of 10 (e.g. 10, 100, 1000 etc.).
In the product information for the latest vDOS version I noticed a fix for "FPU rounding errors." I don't know anything about floating point calculations. But I'm wondering if this fix and upgrading to the latest vDOS might solve my problem.
Here is an example - first a correct calculation then an incorrect example. When encountering a power of ten (in some functions/commands) dBASE multiplies the result by 10.
----- . count for RECNO()<=999 to APPLES && Count record numbers <=999 and assign to variable APPLES 999 records && dBASE correctly counts 999 records . ? APPLES && print the value of APPLES 999.00 && dBASE correctly prints 999.00 -----
. count for RECNO()<=1000 to APPLES && Count record numbers <=1000 and assign to variable APPLES 1000 records && dBASE correctly counts 1,000 records . ? APPLES && print the value of APPLES 10000.00 && dBASE multiplies the value by 10 and incorrectly prints 10000.00 ----- Another example involves determining the number of days between two dates. If the result is 10 days, dBASE returns 100.
BEGINDATE = {5/1/2020} ENDDATE = {5/11/2020} ENDDATE minus BEGINDATE returns 100.
Thank you for your opinions! Frank Mazzocco
|
|
|
Post by Jos on Jan 29, 2021 11:38:33 GMT 1
I’m able to reproduce this power of 10 issue in dBase IV, in vDos 2018.05.01 as well the latest 2020.03.01. dBase V doesn’t have this issue, so dBase IV apparently has some different method to distinguish powers of 10 from other numbers. I’ll have a look at that.
Jos
|
|
|
Post by herman on Jan 29, 2021 12:45:26 GMT 1
What is important with numbers is SET PRECISION = This setting is in your config.db and/or in your prg and determines its completion You can't just subtract dates, that gives unexpected values. The only correct way is <year> <month> day> minus <year> <month> day> So you have to convert these values. Furthermore, dBase 4 (version 1.5 or 2.0) is long obsolete and there are many issues in this. I myself have an official dBase V, but you can also download one at: winworldpc.com/product/dbase/vThere is a dBase V version 1.0 x46 Jun 1994 and a version V 1.0 x58 Aug 1994 with bug fixes. I have been using the latter since the early days and all older dBase prg's also work without problems. The only thing I stumbled upon was setting the country code which was new at the time in this latest version. Sorry for my poor English. Regards Herman
|
|
|
Post by frankmazz on Jan 29, 2021 15:51:56 GMT 1
I’m able to reproduce this power of 10 issue in dBase IV, in vDos 2018.05.01 as well the latest 2020.03.01. dBase V doesn’t have this issue, so dBase IV apparently has some different method to distinguish powers of 10 from other numbers. I’ll have a look at that. Jos Thank you very much for running that test. I will begin looking for an upgrade to dBASE V - Herman has suggested a site and I know it is also available from dbase.com (dBASE LLC). There is no need on my account to look into the powers of 10 differences between IV and V.
I'll also begin my upgrade to the latest vDOS over the weekend. Again, THANKS!
|
|
|
Post by frankmazz on Jan 29, 2021 16:12:36 GMT 1
What is important with numbers is SET PRECISION = This setting is in your config.db and/or in your prg and determines its completion You can't just subtract dates, that gives unexpected values. The only correct way is <year> <month> day> minus <year> <month> day> So you have to convert these values. Furthermore, dBase 4 (version 1.5 or 2.0) is long obsolete and there are many issues in this. I myself have an official dBase V, but you can also download one at: winworldpc.com/product/dbase/vThere is a dBase V version 1.0 x46 Jun 1994 and a version V 1.0 x58 Aug 1994 with bug fixes. I have been using the latter since the early days and all older dBase prg's also work without problems. The only thing I stumbled upon was setting the country code which was new at the time in this latest version. Sorry for my poor English. Regards Herman Herman, your English is excellent! I should apologize for not being multi-lingual.
Thank you for the information about dBASE V versions - I will begin the upgrade process this weekend. I received my current copy of dBASE IV from Ashton-Tate when I was writing training materials for end users. I know I have been "playing with fire," but because I've only used it for personal record keeping I never had a financial need to upgrade. The bug I recently found is now causing me issues and I must change.
FYI - I have a database of +3000 records and did date calculations between each of the records then brought the resulting table into Excel for verification. Of the +3,000 calculations to determine number of days between records (as I showed above) the only errors Excel found were those with differences of exactly 10 days. Using DTOS() followed by VAL() obviously failed because dates are not numbered sequentially across months and years. But the subtraction method worked (except for the bug) - perhaps it was by luck.
Thank you, Frank M
|
|
|
Post by herman on Jan 30, 2021 18:44:59 GMT 1
Hello frankmass,
Indeed, it is also available at dbase.com but not for free. Until now I have not seen this environment as an advantage, as it runs in virtual Dosbox, as I noticed some time ago. Ever asked questions when there was never a good answer.
By the way, I don't see a problem using those on winworldpc.com. I just don't know which subversion that is; and I did not try because I myself have legally purchased (1995).
vDos works completely with my applications with more than 100,000 records.
In DOSBox itself I had problems with output that sometimes lead to problems in the commands to external output. But there were also other problems.
For vDos I had to make very minor adjustments to batch files and the cmd prompt commands compared to Windows 7 x86 NTVDM. They were different in construction for the same results compared to NTVDM or vDos usage . In my applictions I build in detect witch control there is.
In Windows 10 x64 I am working with Hyper V virtual for Windows 7 x86 for a much faster DO WHIL loop handling to generate a lot of different data. Such as Music xml databases generated and replaced MP3 tags and peripheral information, Genealogy records to validate and publishing on the web and earlyer for my work Quality assurance result program to measure quality and a quality registration system.
Some caution is advised with extended characters in your data of your program. Windows 7 x86 and Windows x64 have the difference ANSI and UNICODE as default. Your generated txt or other files may have character corruption after saving and reopening. I'm using batch files with cmd to convert to unicode in x64 and ansi and unicode in x86 respectively commands built in dBase and started in dbase in multiprocessing generetated files.
Herman
|
|