# DROP ALL

DROP ALL is the enhancement added in 4.5 that makes browse lookups function as flexibly as regular lookups. It is now possible to stop the browse lookup from searching the entire file in either direction (forward or backward) based on any criteria. Without DROP ALL, each individual record in an entire file had to be DROPPED individually even after all the desired records were in the browse window.

Example:

58 ------ - - - - - - - - - - - - - - - - -

@keyV If: @cd=""

Then: end

59 ------ - - - - - - - - - - - - - - - - -

If:

Then: td="What beginning date? (yy/mm/dd)\n(RETURN=earliest on file)==>"

60 ------ - - - - - - - - - - - - - - - - -

If:

Then: input popup d(8,ymd/) td

61 ------ - - - - - - - - - - - - - - - - -

If: d=""

Then: d="01/01/01"

62 ------ - - - - - - - - - - - - - - - - -

If:

Then: ba="(brw=18 show=pkeep pop=2 prc=prcV fill=asc,top)"

63 ------ - - - - - - - - - - - - - - - - -

If:

Then: bb="[ChkDate Check# Gross FIT FICA SIT Ded

s Net]"

64 ------ - - - - - - - - - - - - - - - - -

If:

Then: bc="*2 *3 *15 *17 *18 *20 *75

*16"

65 ------ - - - - - - - - - - - - - - - - -

If:

Then: ky=1&d

66 ------ - - - - - - - - - - - - - - - - -

brw1 If:

Then: lookup ref = nexprhst k=ky i=a -ng b=(ba&bb&bc)

67 ------ - - - - - - - - - - - - - - - - -

If: @sk="SAVE"

Then: clearb;end

68 ------ - - - - - - - - - - - - - - - - -

If: @sk="BRKY"

Then: clearb;end

69 ------ - - - - - - - - - - - - - - - - -

If: not ref

Then: clearb;end

70 ------ - - - - - - - - - - - - - - - - -

If: Enter will close down browse

Then: clearb;end

71 ------ - - - - - - - - - - - - - - - - -

prcV If: *prcV

Then:

72 ------ - - - - - - - - - - - - - - - - -

If: ref(1) ne 1

Then: drop all ; end

73 ------ - - - - - - - - - - - - - - - - -

If: ref(2) lt d

Then: drop all ; end

74 ------ - - - - - - - - - - - - - - - - -

If: ref(2) gt d in some cases DROP ALL does it all!

Then: drop all after ; end

75 ------ - - - - - - - - - - - - - - - - -

If: ref(2) lt d and BEFORE and AFTER become superfluous

Then: drop all before ; end

76 ------ - - - - - - - - - - - - - - - - -

If:

Then: end

DROP ALL

Allows all remaining records in a file to be quickly dropped from a browse window.

Syntax

DROP ALL BEFORE

DROP ALL AFTER

DROP ALL

Notes

When using BEFORE and AFTER. the record you are on is also dropped.

Examples

You want to do a lookup browse to see all the invoices for a particular month. Field one of the file is the customer number, field two is the date.

Then: Input dt(2,.0) "what month do you want to see enter 01-12" <dt

If: dt gt " "

Then: lookup inv k=1 i=a -exm b=("brw=8 prc=date file=asc, top)*1 *2

Then: end

date if:

Then: zz=mid(inv(2),"1","2")

If: zz lt dt

Then: drop all before

If: zz gt dt

Then: drop all after

Using this logic, only the records that are in the requested month show and the data processing did not have to be done on every record for that customer.