Author Topic: Variable Browse lookup Window  (Read 1578 times)

0 Members and 1 Guest are viewing this topic.

rkreiss

  • Member
  • Posts: 7
    • View Profile
Variable Browse lookup Window
« on: June 05, 2008, 04:51:21 PM »
Ever have a situation where you have set the browse window size to brw=16 and there are only 3 records to display and then a lot of blank space.  How about now having the ability to fit the window to the number of records to display.

When the processing below is run, the records to display, if any, are counted. See Lines 2-12. 

Line 13 is the key, the browse parameters are set in qa.  When the browse function, at line 20 executes, it uses the value from sz.  4 is added to account for the top and bottom of the window.

Now, I do fix the size after 10 records are found in the file call_list, as there are only a few cases where there are more then 10 records needing to be displayed.

Processing table: variable_browse.prc

--------------------------------------------------------------------------------

1@keylIf:'************************************************************
  Then:'* List names on do not call list
2 If:
  Then:lv=address&street
3 If:
  Then:lookup call = call_list k=lv i=A -nx
4notcallIf:NOT call
  Then:BEEP;MSGBOX "No Names on File\nPress \kZ-Add Names\n\kY-Cancel"
5 If:NOTcall and @sk = "BRKY"
  Then:END
6 If:NOTcall and @sk = "ENTR"
  Then:sz="4";GOTO add_new
7 If:
  Then:lv=address&street&"99"
8 If:
  Then:lookup call = call_list k=lv i=A -nl
9 If:NOT call
  Then:BEEP;ERRORBOX "Error at call list line 124";END
10 If:gcount=""
  Then:sz(2,.0) = "6";GOTO brw_nme
11 If:gcount le "10"
  Then:sz=gcount+"4"
12 If:gcount gt "10"
  Then:sz="16"
13brw_nmeIf:
  Then:qa=chr("40"){("brw="){sz<"show=pkeep mlen=26 xkey=xadu prc=drop_ad fill=asc,top)"
14 If:
  Then:qb="[\b5 Guest Name \a-]"
15 If:
  Then:qc="*3 *5"
16 If:call_list ne "Y"
  Then:call_list="Y";write
17 If:flag ne "7"
  Then:lv=address&street
18 If:flag = "7" 'force browse to display all
  Then:lv=address&street&pg 'new entries
19 If:en ne ""
  Then:en="";pushkey "A"
20 If:
  Then:lookup call = call_list k=lv i=A -nxm b=(qa&qb&qc)
21 If:@bk = "X"
  Then:GOTO end_it
22 If:@bk = "a"
  Then:en="";GOTO add_new
23 If:@bk = "d"
  Then:rn=call(@rn);GOTO del_nme
24 If:@bk = "u"
  Then:rn=call(@rn);GOTO up_name
25end_itIf:
  Then:CLEARB;END

Richard Kreiss
GCC Consulting
email: rkreiss@gccconsulting.net