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=&quot;1&quot;<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+&quot;1&quot;; goto det_lp<br><br>Now create the export detail record:<br><br>mkdtrec◄ If: &#39; ***mkdtrec***<br>       Then:<br> 73  -------   -   -   -   -   -   -<br>       ◄ If:<br>
       Then: detl_ctr=&quot;1&quot;<br><br>Then I create the export detail record using a delimiter (declared for here as &#39;delim&#39;), 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: &#39; ***dtreclp***<br>
       Then:<br>75  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -<br>      ◄ If: detl_ctr eq &quot;1&quot;<br>      Then: export_detail_rec=tot_fields[detl_ctr]; detl_ctr=detl_ctr+&quot;1&quot;; 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+&quot;1&quot;; goto dtreclp<br>
77  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -<br>      ◄ If:<br>      Then: out(1)=export_detail_rec; write out; return<br><br>&quot;out&quot; 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">&lt;<a href="mailto:brian@aljex.com" target="_blank">brian@aljex.com</a>&gt;</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>
&gt; On 5/4/2012 2:02 PM, Walter Vaughan wrote:<br>
&gt;&gt; I know &quot;why&quot; this is a syntax error.<br>
&gt;&gt; My rant is that it would make an ideal place to keep filepro&#39;s record<br>
&gt;&gt; number in exports<br>
&gt;&gt;<br>
&gt;&gt; Then: export ascii psv=(fn) -x<br>
&gt;&gt; Then: psv(0)=@rn{&quot;|&quot;<br>
&gt;&gt; Then: psv(1)=1{&quot;|&quot;<br>
&gt;&gt; ...<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; walter &quot;pipe separated value&quot; vaughan<br>
&gt;&gt;<br>
&gt;<br>
&gt; Not sure why a field in an export would have a null value...<br>
&gt;<br>
&gt; 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&#39;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&#39;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&#39;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(-) + &quot;1&quot; ; atcb = atrn + &quot;1&quot;<br>
psv(atrn)=@rn ; psv(atcb)=@cb<br>
<br>
You&#39;d still get to preserve the filepro file&#39;s structure in the export,<br>
yet add more fields to the export that don&#39;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>