[V4MD] Empty field returns <void>, can it return ""?

Irv Kalb Irv at furrypants.com
Tue Sep 23 12:18:52 CDT 2008


Hi,

I've got a new one today.  I hope I'm not using up my quota of help 
here :)  (I really do appreciate the quick responses here.)

My customer creates their tables in Excel and exports them to tab 
delimited files.  In some of their records, they have no entry for 
one or more fields.  For example, they may have a record with fields 
(all are 'string' fields):

   A  B  C  D  E

And a record may look like:

ValueOfA<tab>ValueOfB<tab>ValueOfC<tab><tab>ValueOfE

In this record, there is no value for D.  When I try to get this 
record in my application, I get a list back like this:

["ValueOfA", "ValueOfB", "ValueOfC", <Void>, "ValueOfE"]

Which seems perfectly reasonable.   However, I am converting code 
from V12 to Valentina, and in the same situation, V12 returned a list 
like this:

["ValueOfA", "ValueOfB", "ValueOfC", "", "ValueOfE"]

So the value I got for D from V12 was an empty string and there is 
code throughout my application that checks for this empty string. 
There are many many places where such empty fields are allowed, and 
in all cases, my code checks for the empty string to know that there 
was no value entered.

Question:  Is there any quick way to either build the database so 
that empty fields are translated the empty string (""), or when 
retrieving data from the database, that <void> values could be 
converted to the empty string("")?   If not, I'll either write my 
own, or change a bunch of code.

My utility to create the database uses the following key line for 
building each table:

   curs.ImportText(sFileName, TAB, RETURN, "UTF-8", TRUE)  -- I also 
tried "" for the encoding with no difference

The documentation talks about a #fNullable flag type for fields, but 
it looks like is an option and not the default.  That is, I would 
only expect them to be set to VOID if the #fNullable attribute was 
turned on.  From what I read, I would expect all string fields to 
default to an empty string, but this is not what I am seeing.


Thanks,

Irv

-- 

Multimedia R Us


More information about the Valentina mailing list