<div> Point taken - but this file is 'static' and records don't change until they get deleted</div>
<div> But I have processing in place if the record isn't there for some reason, I'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"><<a href="mailto:craig@cwtsoftware.com">craig@cwtsoftware.com</a>></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'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>> So I have to use 'rn' as the variable and it will work?<br>> Basically same thing I'm doing I just have to replace my 'ce' variable<br>
> with 'rn'?<br>><br>> On Fri, Feb 3, 2012 at 9:27 AM, Richard Kreiss<<a href="mailto:rkreiss@verizon.net">rkreiss@verizon.net</a>> wrote:<br>><br>>> Top post from phone:<br>>><br>>> To get the new record number after the lookup free add rn=new(@rn). This<br>
>> will be the new record number.<br>>><br>>> Be careful about record numbers as Filepro will add new records to deleted<br>>> records. So it is possible that a new record may be added which has a lower<br>
>> record number the the highest available record number in the file.<br>>><br>>> Richard<br>>> Sent from my iPhone<br>>><br>>> On Feb 3, 2012, at 9:06 AM, "<a href="mailto:scooter6@gmail.com">scooter6@gmail.com</a>"<<a href="mailto:scooter6@gmail.com">scooter6@gmail.com</a>><br>
>> wrote:<br>>><br>>>> I have a process that is adding a record to a file and I need to capture<br>>>> the record number that is being added<br>>>> i.e.<br>>>><br>>>> If = 6 gt @td<br>
>>> Then = lookup new = file r=free -e<br>>>><br>>>> Then = ce(10,*)=new(@rn)<br>>>><br>>>><br>>>> I need 'ce' equal to the record number that is getting added to 'file'<br>
>> so I<br>>>> can do another free lookup that needs<br>>>> the newly created record number in 'file'<br>>>><br>>>> Is this possible?<br>>>> I have tried setting ce after I do a 'write' new but that didn't work<br>
>> either<br>>>> Anyone?<br>>>><br>>>> Scott<br>>>> PDM<br>>>> -------------- next part --------------<br>>>> An HTML attachment was scrubbed...<br>>>> URL:<br>
>> <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>
>>> _______________________________________________<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>> -------------- next part --------------<br>> An HTML attachment was scrubbed...<br>
</div></div>> 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">> _______________________________________________<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>_______________________________________________<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>