These aren't bugs. They are features :) Going all the way back to the beginnings with pick and microdata/reality, math in the F and A processing codes has been integer only. This was on purpose, for speed I think. And it works fine if you follow the fundamental rule of not using decimal points internally. If you want your users to input 3.99 then your input routine should use ICONV to scale it to 399, and then scale again on output.
On d3 (and I guess ultimate) 3.99 x 3 = 9. They do pure integer math in correlatives, truncating decimals. universe emulated this using the decimals but truncating the result. It's slightly more accurate but still keeps decimals out of the results, which was what was expected--it's a feature. F-correlatives are interpreted, but itypes compile their expressions to object code similar to what the basic compiler produces (for performance), and store that object code in the itype item itself. This is another "feature"--the compiled object has to go somewhere, and that's where they put it on universe. That's why you shouldn't display the entire itype item on a terminal--it contains binary object code, some of which will appear to your terminal as control characters, and throw your terminal into odd modes. If that does happen, most good terminal emulators have a menu option to reset the display--you aren't really locked up at that point. If you find yourself experiencing this a lot, you might want to consider putting together a dictionary viewer program (something fancier than LISTF) that will prevent you from displaying the embedded object code, and could also display version info, etc, if you store it. I've never been logged out on universe by using a changed dict without recompiling, but I guess it is possible. In that case you aren't being logged out--you are experiencing a memory error of some kind and aborting. If you can reproduce that then it really is a bug that should be reported. As someone else mentioned, you can use the first attribute of the itype to store arbitrary information--this works on A/S/D type dictionary items as well. universe only looks at the first letter, so anything after that is free to use. However, a better option might be to use some form of source control. On Jan 20, 2011, at 11:45 PM, Kate Stanton wrote: > Does anyone else have a problem with this? > > We have (for about 30 years) allowed users to use a decimal point when > entering quantity. > > In the dim dark past (was it under Prime or Ultimate? don't remember) > we discovered that correlatives ignored anything after a decimal > point, so wrote horrible correlatives multiplying the bit before the > point by 10000, appending 0000 to the bit after, taking the first 4 > chars of this and adding it, doing arithmetic then dividing result by > 10000. > > In the slightly less dim dark past (before 1997, when we introduced > our current change control system), we noticed that this problem had > been fixed, and removed the complication from correlatives involving > quantity. > > Now, many years and much development later, we extensively use > dictionary output rather than programs for reports, forms (eg > invoices) and queries. > > Inaccurate data is an unexpected result. On type S (or A) > dictionaries, result of calculation in A or F correlatives is > truncated to the decimal point (eg 3.99 x 3 = 11). Minor result is > incorrect figures. Major result is under-reporting of totals which > are not able to be reconciled to General Ledger (eg value of stock on > hand). > > Rocket's response is that the manual says correlatives only do integer > arithmetic. This is not quite true, as integer 3.99 x 3 would be 9. > > I-type dictionary items handle the data correctly (3.99 x 3 = 11.97). > > I-types have their own problems, in that fields after 10 are used for > internal purposes, so are not able to carry extra information needed > for data entry (such as data required, display only, validation rules, > data change stamp, etc. > > I-types also are hard to work with as using a changed dictionary > without compiling the dictionary logs the user out, and inadvertent > attempt to display data in fields beyond F10 can lock user up, as well > as untidily logging out. > > We are asking Rocket to consider this a bug. > > What do you think? > > TIA, Kate > > Kate Stanton > Walstan Systems Ltd > 4 Kelmarna Ave, Herne Bay, Auckland 1011, New Zealand > Phone: + 64 9 360 5310 Mobile: + 64 21 400 486 > Email: k...@walstan.com > _______________________________________________ > U2-Users mailing list > U2-Users@listserver.u2ug.org > http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users