export gotcha

Robert Haussmann haussma at nextdimension.net
Sun Nov 14 14:15:56 PST 2004


Here's a head's up to anyone using the export command to 
create external files, in the hopes of saving someone
else a few hours of troubleshooting time.

There's a potential conflict in naming arrays/variables and 
exports that can cause unexpected results.  This is on
fileProODBC 1.0.13, though it probably exists on 
other platforms as well.

If you dimension an array with a name that ends in the
same as one of your exports, filePro can see the size
of the array as an export field, and set the maximum size
of export record incorrectly.

For example:

dim to_email(100)(30,*)
export ascii email=c:\temp.out r=\n f=\n
email(1)="test";write email

While this should create a file with one record and
one field terminated by a newline, what you actually get
is one record with 100 fields, each terminated by a newline.
If the name of the export is changed to something other than
"email", you get the expected behavior.

A quick test shows that it is not limited to array names,
but long variables as well (e.g., replace the first line
with "declare to_email(100,*)" and you get the same
result.

Bob Haussmann
Tabor Children's Services, Inc.




More information about the Filepro-list mailing list