DROP ALL fails when no records have been selected (long)
Barry Wiseman
bwiseman at optonline.net
Wed Nov 7 10:38:46 PST 2007
GCC Consulting wrote:
>
>
>> [snip]
>>
>> Here is a simplified piece of code that will demonstrate the
>> problem.
>>
>> [snip]
>>
>> ::end:
>> @KEYQ:::
>> ::qq(20,*)="ZUPNICK 362429999":
>> ::qx(20,*)="ZUPNICK 34051 ":
>> ::zz="(brw=12 xkey=X prc=BPRC fill=desc,top)":
>> ::zz=zz { "[Key Invoice]*4 *3":
>> ::lookup vtr = drvtrans k=qq i=A -nl b=(zz):
>> ::end:
>> BPRC::qz=vtr(4)&vtr(3):
>> ::msgbox qz:
>> :qz lt qx:drop all after; end:
>> :qz gt qq:drop all before; end:
>> ::end:
>>
>> [snip]
>
> Barry,
>
> Might I suggest that you break the drop into 2 checks
> Test for first field value of index
> :this_name le "name_field":drop all before;end
> :this_name gt "name_field":drop all after;end
> :starting_number lt number_field;drop all before;end
> :ending_number gt number_field;drop all after;end
>
> Since it appears that you are only testing the first 5 digits of the number
> field, the use starting_number lt mid(number_field,"1","5").
>
> This is a few more lines but should solve your problem.
>
> Richard Kreiss
> GCC Consulting
Richard, thanks for the suggestion. Recoding the test processing as
follows does not change the behavior.
BPRC::msgbox qz:
:vtr(4) lt "ZUPNICK ":drop all after; end:
:vtr(3) lt " 34051":drop all after; end:
:vtr(4) gt "ZUPNICK ":drop all before; end:
:vtr(3) gt " 36242":drop all before; end:
::end:
clerk still cycles through all records to the end of the file and does
not respect the DROP ALL. As I said, I suspect DROP ALL is relative to
the last *selected* record, and in this case there are none.
More information about the Filepro-list
mailing list