Groups > dBase > Getting Started with dBase > Re: Strateegery




Re: Strateegery

Re: Strateegery
Wed, 12 Mar 2008 18:51:05 -070
There is absolutely nothing wrong with storing numeric data in numeric 
fields.  That is why those types of fields exist.  I don't know where you 
heard it's better to store numeric data as string data.  It's a matter of 
preference, of course, but it's less work storing numeric as numeric and if 
you need string data somewhere, convert it then - when you neeed it that 
way.

bigMike



"DON" <drplum@verizon.net> wrote in message 
news:lnaKuhKhIHA.1952@news-server...
> Hello All
>
> First just want to say I enjoy reading all the Dbase code problems. I have

> learned alot. Thanks to all the Pros
>
> My question this time is on storing data in DBF Files.
>
> I have read previously its best to numeric data as strings with no decimal

> pts and convert it as needed.
>
> However I use a few spinboxes in some of my forms and they need to hook up

> to numeric data.
>
> In you alls experience, do numeric data fields in DBFs hold up ok, are 
> there any problems using numeric data types for DBF fields??
>
> Thanks For any Comments
>
> Don
>
> 

Post Reply
Strateegery
Wed, 12 Mar 2008 20:20:31 -050
Hello All

First just want to say I enjoy reading all the Dbase code problems. I have
learned alot. Thanks to all the Pros

My question this time is on storing data in DBF Files.

I have read previously its best to numeric data as strings with no decimal pts
and convert it as needed.

However I use a few spinboxes in some of my forms and they need to hook up to
numeric data.

In you alls experience, do numeric data fields in DBFs hold up ok, are there any
problems using numeric data types for DBF fields??

Thanks For any Comments

Don

Post Reply
Re: Strateegery
Wed, 12 Mar 2008 20:21:28 -070
DON wrote:
> Hello All
> 
> First just want to say I enjoy reading all the Dbase code problems. I have
learned alot. Thanks to all the Pros
> 
> My question this time is on storing data in DBF Files.
> 
> I have read previously its best to numeric data as strings with no decimal
pts and convert it as needed.
> 
> However I use a few spinboxes in some of my forms and they need to hook up
to numeric data.
> 
> In you alls experience, do numeric data fields in DBFs hold up ok, are
there any problems using numeric data types for DBF fields??

What bigMike said ...

The times that storing numerics as character makes sense is if you are 
never doing math on the number (phone number, postal code, ssn ...). 
Otherwise, store it as a number. Not a problem.

Ken

-- 
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
Post Reply
Re: Strateegery
Thu, 13 Mar 2008 02:10:00 -040
In article <lnaKuhKhIHA.1952@news-server>, drplum@verizon.net says...
> Hello All
> 
> First just want to say I enjoy reading all the Dbase code problems. I have
learned alot. Thanks to all the Pros
> 
> My question this time is on storing data in DBF Files.
> 
> I have read previously its best to numeric data as strings with no decimal
pts and convert it as needed.
> 
> However I use a few spinboxes in some of my forms and they need to hook up
to numeric data.
> 
> In you alls experience, do numeric data fields in DBFs hold up ok, are
there any problems using numeric data types for DBF fields??
> 
> Thanks For any Comments
> 
> Don
> 


Don,

Where caution is advised with numeric values is when using them for 
indexes. Integers seem to work fine (at least for me), but floating 
point values (something with the potential to have a value after that 
decimal point) can be unreliable on occasion. Others have suggested even 
integers can be a problem under certain circumstances, so that leads to 
the general advice to stick to characters. But it is only for *indexes*.

-- 
Geoff Wass [dBVIPS]
Montréal, Québec, Canada

.|.|.|        dBASE info at http://geocities.com/geoff_wass       |.|.|.
.|.|.| ---------------------------------------------------------- |.|.|.
Post Reply
Re: Strateegery
Thu, 13 Mar 2008 19:42:02 -050
Geoff Wass [dBVIPS] Wrote:

> In article <lnaKuhKhIHA.1952@news-server>, drplum@verizon.net
says...
> > Hello All
> > 
> > 
> > I have read previously its best to numeric data as strings with no
decimal pts and convert it as needed.
> > 
> > However I use a few spinboxes in some of my forms and they need to
hook up to numeric data.
> > 
> > In you alls experience, do numeric data fields in DBFs hold up ok, are
there any problems using numeric data types for DBF fields??
> > 
> > Thanks For any Comments
> > 
> > Don
> > 
> 
> 
> Don,
> 
> Where caution is advised with numeric values is when using them for 
> indexes. Integers seem to work fine (at least for me), but floating 
> point values (something with the potential to have a value after that 
> decimal point) can be unreliable on occasion. Others have suggested even 
> integers can be a problem under certain circumstances, so that leads to 
> the general advice to stick to characters. But it is only for *indexes*.
> 
> -- 
> Geoff Wass [dBVIPS]
> Montréal, Québec, Canada
> 
> .|.|.|        dBASE info at http://geocities.com/geoff_wass       |.|.|.
> .|.|.| ---------------------------------------------------------- |.|.|.
> .|.|.|             IT Consultant http://Geoff_Wass.com            |.|.|.

Thanks Geoff
Yes I would use Integer type only for my key value; and fill evey space as is
also recommended in other literature.

Ie I dont start with one
I would start with 1000001 for a 7 byte field

Post Reply
<< Previous 1 2 Next >>
( Page 1 of 2 )
about | contact