Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 5 of 5 total |
Can I mimic a "currency" data type when field defs are read into Delphi. |
Thu, Jan 27 2011 6:42 AM | Permanent Link |
Adam Brett Orixa Systems | I don't tend to work too much on GUI. I try to let the my application framework do as much work as possible.
So usually I don't design forms or user GUI, I have systems which read the incoming structure of the data-types of the data and create edits that will "look nice". In DBISAM I could choose Currency data-type for currency fields & Float data-type for other accurate numbers. the GUI then knows (without me asking) to put the relevant currency symbol & formatting around the data, and have appropriate editor capabilities for that type of field (calculator drop-downs etc.) In ELEVATE we don't have a currency type. We have FLOAT, DECIMAL & DOUBLE PRECISION. Previously I was writing code: case Fields[i].datatype of ftFloat : dosomething; ftCurrency : dosomethingelse; //... etc end; .... is there a way of picking up the difference between FLOAT, DECIMAL & DOUBLE PRECISION in code? |
Thu, Jan 27 2011 8:50 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Adam
Tim or someone else may be able to give you a better answer but mine would be to stop using Fields and start using the data stored in the catalog. As a half way house what you could do is check the actual datatype according to ElevateDB where there is some confusion. eg SELECT Type FROM Information.TableColumns WHERE TableName = 'xyz' AND Name = 'ABC' Roy Lambert [Team Elevate] |
Thu, Jan 27 2011 1:34 PM | Permanent Link |
Adam Brett Orixa Systems | Great idea Roy, It would be a simple function call in my Delphi DB pas code & I could then (I assume) access types like DECIMAL etc. & use these to determine my GUI. Could also write special code to present COMPUTED fields in a nice way ... uuum.
Thanks |
Thu, Jan 27 2011 5:16 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Adam,
<< In DBISAM I could choose Currency data-type for currency fields & Float data-type for other accurate numbers. the GUI then knows (without me asking) to put the relevant currency symbol & formatting around the data, and have appropriate editor capabilities for that type of field (calculator drop-downs etc.) >> I would use the DECIMAL type for all currency columns. That will allow you to keep doing what you're doing in Delphi code, but instead of ftCurrency, just look for ftBCD. You could keep any DOUBLE columns with the ftFloat check. -- Tim Young Elevate Software www.elevatesoft.com |
Fri, Jan 28 2011 5:13 AM | Permanent Link |
Adam Brett Orixa Systems | Thanks Tim,
That way I only have to change 5 characters in the code & I keep the functionality, excellent! Adam |
This web page was last updated on Thursday, May 23, 2024 at 07:54 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |