Dynamically built selection sets
Bill Vermillion
fp at wjv.com
Wed Jul 7 14:18:19 PDT 2004
On Wed, Jul 07 16:09 , GCC Consulting, showing utter disregard for
spell-checkers gave us this:
> > The selection file is ASCII and I have seen many programmers
> > collect the data it requires with processing and create a
> > sel.table and then use it to run a report.
> > What you are suggesting is easy to do.
> > I think I would have two processes like this:
> > dreport filename -fp asksel -s none
> > Make a process called asksel, get the data you need and write
> > the selection table. You can use any file if you put the
> > logic in the @done part of the process table and use a
> > selection table that does not pick any records.
> > Then run the report you really want using the selection table created:
> > dreport filename -f report -s new selection
> > That would do it.
> > Be careful in the asksel to start the table with a line that
> > has the END command then the second line should be @DONE and
> > do what you need.
> I realize where both of you are coming from. However it is
> possible to write -v selection processes that do as much or
> more the selection sets.
> I have some selection processes which, based on the initial
> option, allows for ever more finite selection criteria to be
> entered.
> This also would include changing the sort sequence of the data
> selected.
> As you are well aware, one of the best uses of select
> processing is the use of the dash lookup to speed the selection
> of records where possible.
I just found some old code I used on a 4.1 that was dynamic, and
you built the items to select one at a time. This was originally
used to select out particular pieces of data from a main-frame
application where there could be 20-40 codes possible.
I also have one that inverts the selection so the codes you enter
are the ones NOT selected.
This code dates to about 1995. The users liked it - and that's
what counts I guess. You have a dynamically update listed of what
you have selected on the screen for each item you enter.
========================================
:' modify of original to ask if multiple key search or just one::
::za(30,*,g); zb(2,.0,g); fl(1,*,g);:
::zc(54,*) = "Please enter the code or codes for the search.":
::zd(38,*) = "Enter a blank code to end the input.":
::ze(32,*) = "So far you have entered codes -":
:fl eq "":gosub getcod; fl = "Y":
init::dim code[20](2,.0)ca:
::x = "1":
:1 ne "":gosub getdat:
::end:
getdat: '*************::
::lookup dat = ptrakdat k=1 i=a -nx:
:not dat:return:
datloop:dat:code[x] = dat(2):
:dat:ky = code[x]:
:dat and za co code[x]:select:
::getnext dat:
:not dat:return:
:dat(1) ne 1:return:
:dat(1) eq 1:x = x + "1":
::goto datloop:
getcod: '******************::
::input popup zb " \n " <zc< "\n " <zd< " \n " < ze < "\r" <za< "\r \n ":
:zb ne "":za = za < zb ; goto getcod:
:zb eq "":msgbox " \n You selected \r" <za< "\r as the search code(s). \n Is this correct? \n ","Enter \r Y \r or \r N \r .","YN":
:@bk eq "Y":return:
:@bk eq "N":za = ""; zb = ""; goto getcod:
::errorbox " \n You must enter a \r Y \r or an \r N \r ! \n "; goto getcod:
: '********** end of processing table ************::
========================================
--
Bill Vermillion - bv @ wjv . com
More information about the Filepro-list
mailing list