Brian, I do simplify the exports to a few lines, even with 999 fields.<br><br>First I fill an array with the values of each filed in the record<br><br>okdtrec◄ If:<br> Then: field_ctr="1"<br> 69 ------- - - - - - - - - - - -<br>
det_lp ◄ If: field_ctr gt numfield(-)<br> Then: goto mkdtrec<br> 70 ------- - - - - - - - - - - -<br> ◄ If:<br> Then: tot_fields[field_ctr]=fieldval(-,field_ctr)<br> 71 ------- - - - - - - - - - - -<br>
◄ If:<br> Then: field_ctr=field_ctr+"1"; goto det_lp<br><br>Now create the export detail record:<br><br>mkdtrec◄ If: ' ***mkdtrec***<br> Then:<br> 73 ------- - - - - - -<br> ◄ If:<br>
Then: detl_ctr="1"<br><br>Then I create the export detail record using a delimiter (declared for here as 'delim'), usually a pipe, to delimit each field and export one record at a clip containing all the fields pipe-delimited<br>
<br> 74 ------- - - - - - -<br>
dtreclp◄ If: ' ***dtreclp***<br>
Then:<br>75 ------- - - - - - - - - - - - - - - - -<br> ◄ If: detl_ctr eq "1"<br> Then: export_detail_rec=tot_fields[detl_ctr]; detl_ctr=detl_ctr+"1"; goto dtreclp<br>
76 ------- - - - - - - - - - - - - - - - -<br> ◄ If: detl_ctr le numfield(-)<br> Then: export_detail_rec=export_detail_rec{delim{tot_fields[detl_ctr]; detl_ctr=detl_ctr+"1"; goto dtreclp<br>
77 ------- - - - - - - - - - - - - - - - -<br> ◄ If:<br> Then: out(1)=export_detail_rec; write out; return<br><br>"out" being the alias I gave to my export file<br><br>
export ascii out = (exp_filename) r=\n<br><br>Not quite 2 or 3 lines, but about 10 lines and can be used for any number of fields.<br><br>Now a simple addition to the export detail record using this method would allow you to append record number, @cd, etc as you deem fit, <br>
<br>I hope that makes sense.<br><br><div class="gmail_quote">On Mon, May 7, 2012 at 2:18 PM, Brian K. White <span dir="ltr"><<a href="mailto:brian@aljex.com" target="_blank">brian@aljex.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 5/4/2012 5:59 PM, Scott Nelson wrote:<br>
> On 5/4/2012 2:02 PM, Walter Vaughan wrote:<br>
>> I know "why" this is a syntax error.<br>
>> My rant is that it would make an ideal place to keep filepro's record<br>
>> number in exports<br>
>><br>
>> Then: export ascii psv=(fn) -x<br>
>> Then: psv(0)=@rn{"|"<br>
>> Then: psv(1)=1{"|"<br>
>> ...<br>
>><br>
>> --<br>
>> walter "pipe separated value" vaughan<br>
>><br>
><br>
> Not sure why a field in an export would have a null value...<br>
><br>
> I guess if you Could do psv(@rn)=@rn that would make sense.<br>
<br>
</div>I think his point was just that it would be real nice to be able to<br>
specify export field number starting at 0, so that you could put<br>
something like record number or the equivalent or copy of the 20 byte<br>
header etc in field 0 and then the rest of the record could still map<br>
export fields to the same numbers as the original fields.<br>
<br>
If you could put a variable in the export field index, you could divine,<br>
or at least define, the highest field number plus one and name that O so<br>
the code could read psv(O) = header/recno/etc followed by psv(1)=1<br>
psv(2)=2 etc... which would be just about as good for the programmer<br>
even though the file would be placing the metadata field on the end of<br>
the records instead of the beginning.<br>
<br>
Myself I just avoided ever expecting the export to match especially<br>
litteraly with any real filepro fields so I've never really missed a<br>
feature like this but I see how it would be nice sometimes.<br>
<br>
For one thing, since there are not just one but several different<br>
possible things you might want to put into a zeroth field so that you<br>
could still have export field 1 = filepro field 1, if you're going to<br>
allow a zero field to support prepending one field, you might as well<br>
also allow negative fields and prepend as many other fields as you want.<br>
<br>
Or allow variables in the export field index which we've wanted forever<br>
anyways, (since it would simplify many exports to 2 or 3 lines of code<br>
even if the file has 999 fields). If you could use variables instead of<br>
literal field numbers to specify the export field number, you could name<br>
fields anything you want like<br>
atrn = numfield(-) + "1" ; atcb = atrn + "1"<br>
psv(atrn)=@rn ; psv(atcb)=@cb<br>
<br>
You'd still get to preserve the filepro file's structure in the export,<br>
yet add more fields to the export that don't exist in the filepro file,<br>
without even having to manually specify the correct<br>
highest-real-field-number-plus-one, plus 2 etc...<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
bkw<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Filepro-list mailing list<br>
<a href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a><br>
Subscribe/Unsubscribe/Subscription Changes<br>
<a href="http://mailman.celestial.com/mailman/listinfo/filepro-list" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a><br>
</div></div></blockquote></div><br>