<div>   Point taken - but this file is &#39;static&#39; and records don&#39;t change until they get deleted</div>
<div>   But I have processing in place if the record isn&#39;t there for some reason, I&#39;ll know about it</div>
<div>   Thanks again<br><br></div>
<div class="gmail_quote">On Fri, Feb 3, 2012 at 9:54 AM, Craig Tooker <span dir="ltr">&lt;<a href="mailto:craig@cwtsoftware.com">craig@cwtsoftware.com</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">The variable name does not matter.  The type does.  It should be a .0<br>type such as CE(8,.0).  The @RN is a system variable that in the case of<br>
new(@RN) will return the record number of the current lookup named new.<br><br>I *think* what Richard was trying to say was that you should be very<br>careful with a database design that uses record numbers as an access<br>
method to retrieve sub (or deity forbid) master records.<br><br>There are too many instances when you will want to restructure a<br>database which will cause the record numbers to change (such as packing<br>a file or a re-design).  Always try to use unique keys which are<br>
normalized in the database design and avoid using record numbers.<br><br>To answer your question in your first post, the record number is<br>assigned [and is available via new(@RN)] immediately after the lookup<br>-free which creates the record.  Before or after the write.<br>
<br>In the example you supplied, you may have a logic problem if 6 le @TD<br>because it will fall through the lookup and break on the following line<br>that references a lookup that has not been performed.  You may know that<br>
will never happen so perhaps I&#39;m nitpicking.<br><br>Craig<br>
<div>
<div></div>
<div class="h5"><br>On 2/3/2012 09:40, <a href="mailto:scooter6@gmail.com">scooter6@gmail.com</a> wrote:<br>&gt;     So I have to use &#39;rn&#39; as the variable and it will work?<br>&gt;     Basically same thing I&#39;m doing I just have to replace my &#39;ce&#39; variable<br>
&gt; with &#39;rn&#39;?<br>&gt;<br>&gt; On Fri, Feb 3, 2012 at 9:27 AM, Richard Kreiss&lt;<a href="mailto:rkreiss@verizon.net">rkreiss@verizon.net</a>&gt;  wrote:<br>&gt;<br>&gt;&gt; Top post from phone:<br>&gt;&gt;<br>&gt;&gt; To get the new record number after the lookup free add rn=new(@rn). This<br>
&gt;&gt; will be the new record number.<br>&gt;&gt;<br>&gt;&gt; Be careful about record numbers as Filepro will add new records to deleted<br>&gt;&gt; records. So it is possible that a new record may be added which has a lower<br>
&gt;&gt; record number the the highest available record number in the file.<br>&gt;&gt;<br>&gt;&gt; Richard<br>&gt;&gt; Sent from my iPhone<br>&gt;&gt;<br>&gt;&gt; On Feb 3, 2012, at 9:06 AM, &quot;<a href="mailto:scooter6@gmail.com">scooter6@gmail.com</a>&quot;&lt;<a href="mailto:scooter6@gmail.com">scooter6@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>&gt;&gt;<br>&gt;&gt;&gt; I have a process that is adding a record to a file and I need to capture<br>&gt;&gt;&gt; the record number that is being added<br>&gt;&gt;&gt; i.e.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; If = 6 gt @td<br>
&gt;&gt;&gt; Then = lookup new = file   r=free   -e<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Then = ce(10,*)=new(@rn)<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; I need &#39;ce&#39; equal to the record number that is getting added to &#39;file&#39;<br>
&gt;&gt; so I<br>&gt;&gt;&gt; can do another free lookup that needs<br>&gt;&gt;&gt; the newly created record number in &#39;file&#39;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Is this possible?<br>&gt;&gt;&gt; I have tried setting ce after I do a &#39;write&#39; new but that didn&#39;t work<br>
&gt;&gt; either<br>&gt;&gt;&gt; Anyone?<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Scott<br>&gt;&gt;&gt; PDM<br>&gt;&gt;&gt; -------------- next part --------------<br>&gt;&gt;&gt; An HTML attachment was scrubbed...<br>&gt;&gt;&gt; URL:<br>
&gt;&gt; <a href="http://mailman.celestial.com/pipermail/filepro-list/attachments/20120203/2a5a65de/attachment.html" target="_blank">http://mailman.celestial.com/pipermail/filepro-list/attachments/20120203/2a5a65de/attachment.html</a><br>
&gt;&gt;&gt; _______________________________________________<br>&gt;&gt;&gt; Filepro-list mailing list<br>&gt;&gt;&gt; <a href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a><br>&gt;&gt;&gt; Subscribe/Unsubscribe/Subscription Changes<br>
&gt;&gt;&gt; <a href="http://mailman.celestial.com/mailman/listinfo/filepro-list" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a><br>&gt; -------------- next part --------------<br>&gt; An HTML attachment was scrubbed...<br>
</div></div>&gt; URL: <a href="http://mailman.celestial.com/pipermail/filepro-list/attachments/20120203/9e1394fe/attachment.html" target="_blank">http://mailman.celestial.com/pipermail/filepro-list/attachments/20120203/9e1394fe/attachment.html</a><br>

<div>
<div></div>
<div class="h5">&gt; _______________________________________________<br>&gt; Filepro-list mailing list<br>&gt; <a href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a><br>&gt; Subscribe/Unsubscribe/Subscription Changes<br>
&gt; <a href="http://mailman.celestial.com/mailman/listinfo/filepro-list" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a><br>_______________________________________________<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>