Error "deleted key is not found"
Jeff Harrison
jeffaharrison at yahoo.com
Thu Aug 24 19:35:12 PDT 2006
--- Richard Tartaglia <fp_rich at yahoo.com> wrote:
> Hope all is well with everyone.
>
> FP 5.0.14 , Windows
>
> I am attempting to write an auto posting table.
>
> A person in my files may have many records or just
> 1.
> Some of those records may be posted as paid and some
> not.
>
> Index B is sorted on the name, field(1), and date
> paid
> field(2). When typing a persons name you will see
> the
> unpaid records first because the payment date is
> blank.
>
> When standing on a record, key P activates the table
> with @keyP processing.
>
> @keyp : '@keyP
> :
> :nm(60)=1 ' set name
> :
> post :lookup test k=nm I=B -nx
> :not test
> :input popup yn "There is a problem"
> :not test
> :end
> :test(1)=nm and test=""
> :test(2)=@t4 ; test(40)=Test(44)'date amount
>
>
> :
> :write test
> :
> :goto post
> :
> :end
>
> This works for until it gets to the last unpaid
> record
> and I get an error
>
> Deleted key is not found
> Index = test/index.B
> Key="Bean Mark J "
> Recno=1
> tptr=2,1,2,1,0
>
> I have never seen this error before and I am so good
> at this I thought I had seen them all.
> I think it is because I am looking up the record
> with
> the same index I am using for the lookup.
>
> Any help would be appreciated so I can get back to
> playing with my toys.
>
> Thanks
> Rich Tartaglia
Hi Rich. I haven't tested this, but it seems to me
that at least part of your problem is with the fact
that you are looking up to the record that you are
sitting on. Also, I'm not sure how you would ever
expect for your loop to end. Won't your lookup always
get the same record?
A line in your code has 'test=""' on the if line.
That seems like a typo to me. Did you mean test(2) eq
"" ?
I think you need something like the following:
(Untested)
@keyp::nm(60)=1 ' set name :
::lookup test k=nm I=B -nx:
post:::
:not test:msgbox "Done"; end:
:test(1) ne nm:msgbox "Done"; end:
:@rn eq test(@rn):2=@t4; 40=test(44); write; goto
post:
:test(2) eq "":test(2)=@t4 ; test(40)=Test(44); write
test 'date mount:
::getnext test:
::goto post:
Ideally this would be modified to handle record
locking, but I did not want to confuse the issue for
you.
Good Luck.
Jeff Harrison
jeffaharrison at yahoo.com
Author of JHImport and JHExport. The fastest and
easiest ways to create code for filePro Imports and
Exports.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the Filepro-list
mailing list