Dynamically built selection sets
GCC Consulting
gcc at optonline.net
Wed Jul 7 23:15:11 PDT 2004
>
> 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 ************::
Just a layout of program question.
If one is creating a selection program, why place the gathering of the selection
criteria at the top and the actual selection processing at the bottom of the
table?
Since the entry of the selection criteria is done once and the selection process
runs more then once, it seems more logical to place the entering of the criteria
at the bottom of the processing table and the selection routines at the top.
I realize that with the speed of the current computers, a gosub or goto doesn't
take much time. However, is it much simpler to debug a selection program if the
one doesn't have to jump to the bottom of the processing table on each record.
I have some selection processing table which have a few hundred line of code to
get and verify the information for a report. The actual selection routines only
take up about 20 line of code. A Couple hundred line run once; 20 line or fewer
run on each record.
Granted one could run @once processing today to get information. But where in
your coding would you place it?
Top or bottom??
Richard Kreiss
GCC Consulting
More information about the Filepro-list
mailing list