Re: Logical fields in MySQL, field mapping from VFP to MySQL

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Christian Ehlscheid (ehlscheid-no-spam_at_edv-ermtraud.de)
Date: 03/17/04


Date: Wed, 17 Mar 2004 17:38:38 +0100

Hello,

yes .. it's the best option ..
it also integrates good into the user interface since checkboxes can be
bound to numeric types ..

we currently use numeric types exclusively instead of logical .. cause we
have to target different backends ..(foxpro, oracle, mssql and mysql) and
only FoxPro has a native boolean type

the MsSQL odbc driver is also smart enought to convert BIT to boolean in
FoxPro .. but with all other backends you're lost ..

the new cursoradapter is also of no help in this context ..
cause this unfortunately doesn't work:

DEFINE CLASS oSomeAdapter AS CursorAdapter ..
SelectCmd = 'SELECT someNumeric FROM someTable WHERE someCondition'
Cursorschema = 'someNumeric L'
ENDDEFINE

you'll get error 1543: Type conversion required by the DataType property
for field 'someNumeric' is invalid.

this is a bit odd since it isn't a big problem to convert a numeric into a
boolean ..
e.g. lbBool = (numeric=0) & like it is handled in C

Regards

Christian

"Ook" <outlookexpress@nospam@embertsdotcom> schrieb im Newsbeitrag
news:uIEWXjCDEHA.3348@TK2MSFTNGP11.phx.gbl...
> So would you agree that logical values should be replaced with numeric 1/0
> values instead? Everything else looks pretty straight forward.



Relevant Pages

  • Re: Logical fields in MySQL, field mapping from VFP to MySQL
    ... VFP does accept 1/0 instead of T/F in a number of object properties, ... > we currently use numeric types exclusively instead of logical .. ... > only FoxPro has a native boolean type ... > the new cursoradapter is also of no help in this context .. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Differences between VB6 and VB.Net causing problem
    ... Converts them both to the same type (Boolean) and does the compare. ... I was pointign you to Larry his assumption that the Byte was beign converted to a Booelan in the expression If bln = CByteThen was clearly wrong. ... CSngis a perfectly valid conversion, albeit a highly unlikely one, and it will indeed return -1, but it certainly doesn't return all bitwise 1's when examined at the bit level. ... It is only in the bittable numeric types where bitwise operations can be used, and in those types the conversion of a Boolean is either 0 or bitwise Not 0. ...
    (microsoft.public.vb.general.discussion)
  • Re: Interesting list Validity (True/False)
    ... except different numeric types and ... different string types, never compare equal; ... "a list is a boolean"? ... they both have a 1 at index position 0? ...
    (comp.lang.python)
  • Re: Uninitialized boolean variables?
    ... Boolean variables are False ... Numeric variables are 0 ... As you note in your post the default values for numeric types (boolean ... for strings it is an empty string. ...
    (microsoft.public.vb.general.discussion)