Friday afternoon rant
Brian K. White
brian at aljex.com
Mon May 7 11:18:32 PDT 2012
On 5/4/2012 5:59 PM, Scott Nelson wrote:
> On 5/4/2012 2:02 PM, Walter Vaughan wrote:
>> I know "why" this is a syntax error.
>> My rant is that it would make an ideal place to keep filepro's record
>> number in exports
>>
>> Then: export ascii psv=(fn) -x
>> Then: psv(0)=@rn{"|"
>> Then: psv(1)=1{"|"
>> ...
>>
>> --
>> walter "pipe separated value" vaughan
>>
>
> Not sure why a field in an export would have a null value...
>
> I guess if you Could do psv(@rn)=@rn that would make sense.
I think his point was just that it would be real nice to be able to
specify export field number starting at 0, so that you could put
something like record number or the equivalent or copy of the 20 byte
header etc in field 0 and then the rest of the record could still map
export fields to the same numbers as the original fields.
If you could put a variable in the export field index, you could divine,
or at least define, the highest field number plus one and name that O so
the code could read psv(O) = header/recno/etc followed by psv(1)=1
psv(2)=2 etc... which would be just about as good for the programmer
even though the file would be placing the metadata field on the end of
the records instead of the beginning.
Myself I just avoided ever expecting the export to match especially
litteraly with any real filepro fields so I've never really missed a
feature like this but I see how it would be nice sometimes.
For one thing, since there are not just one but several different
possible things you might want to put into a zeroth field so that you
could still have export field 1 = filepro field 1, if you're going to
allow a zero field to support prepending one field, you might as well
also allow negative fields and prepend as many other fields as you want.
Or allow variables in the export field index which we've wanted forever
anyways, (since it would simplify many exports to 2 or 3 lines of code
even if the file has 999 fields). If you could use variables instead of
literal field numbers to specify the export field number, you could name
fields anything you want like
atrn = numfield(-) + "1" ; atcb = atrn + "1"
psv(atrn)=@rn ; psv(atcb)=@cb
You'd still get to preserve the filepro file's structure in the export,
yet add more fields to the export that don't exist in the filepro file,
without even having to manually specify the correct
highest-real-field-number-plus-one, plus 2 etc...
--
bkw
More information about the Filepro-list
mailing list