Message when no selection occurs
John Esak
john at valar.com
Fri Feb 17 15:08:55 PST 2006
I saw a suggestion to use @done... Unfortunately, @done does not work on
sort/selectin tables. You can use a global variable and test on the output
format, then not print... if it isn't set to "1". You could use your
f(1,*,g), but this would require that it be dfined on the automatic table...
for it to be seen and available on your output table. So instead I suggest
the following.
instead of your code on the selection table:
. If: 'A match has been found
.
Then: select;f(1,*,g) ="1";end
.
16 ------- - - - - - - - - - - - - - - - -
. If:
.
you could put:
then: declare global match_found(1,*,g)
. If: 'A match has been found
.
if:
then: select; match_found="1"
. If:
.
Then: end
.
Then, on your output format put:
1 if: match_found eq ""
then: exit
2 if:
then: ... whatever processing you had on the output format already...
3 if:
then: print; end
Just make sure the PRINT statement is somewhere on the table. If it sin't
there, this scheme would not work.
There are many other ways to do this sort of thing... this seemed easiest.
John Esak
-----Original Message-----
From: filepro-list-bounces at lists.celestial.com
[mailto:filepro-list-bounces at lists.celestial.com]On Behalf Of GCC Consulting
Sent: Friday, February 17, 2006 4:53 PM
To: 'Larry Dannenberg'; 'filepro Mailing List'
Subject: RE: Message when no selection occurs
From: filepro-list-bounces+gccconsulting=comcast.net at lists.celestial.com
[mailto:filepro-list-bounces+gccconsulting=comcast.net at lists.celestial.com]
On Behalf Of Larry Dannenberg
Sent: Friday, February 17, 2006 4:37 PM
To: filepro Mailing List (filepro-list at lists.celestial.com)
Subject: Message when no selection occurs
I have a brief table that looks for duplicate records and prints them. If no
duplicates are found, the selection table terminates and no printout is
generated. Users may think the table did not run when this occurs so I would
like to print a message to the monitor when no records are selected.
When filePro is on the last index, the selection table below prints a
message box for as many times as there is a record containing the last item
in the index (in this case, the last customer number).
Is there a better way to do this? I would like to print 1 message to the
monitor if no records are selected.
7 ------- - - - - - - - - - - - - - - - -
. If: 'lookup key based on consumer number, index (C) based on
consumer#.
Then: lookup one = MRattenddays k=32 i=c -nx
.
8 ------- - - - - - - - - - - - - - - - -
loop . If: not one and f eq ""
.
Then: msgbox "No Duplicate Records Were Found." & "\nThe last
consumer # <32<"and\nthe corresponding record #=" < @rn;end
9 ------- - - - - - - - - - - - - - - - -
. If: not one
.
Then: end
.
10 ------- - - - - - - - - - - - - - - - -
. If: 32 ne one(32) 'Consumer number does not match
.
Then: end
.
11 ------- - - - - - - - - - - - - - - - -
. If: 'save the looked up record as qn
.
Then: qn=one(@rn)
.
12 ------- - - - - - - - - - - - - - - - -
. If: @rn eq qn 'this is the same record
.
Then: getnext one;goto loop
.
13 ------- - - - - - - - - - - - - - - - -
. If: 35 ne one(35) 'this is not for the same month/year
.
Then: getnext one;goto loop
.
14 ------- - - - - - - - - - - - - - - - -
. If: 36 ne one(36) 'this is not for the same location
.
Then: getnext one;goto loop
.
15 ------- - - - - - - - - - - - - - - - -
. If: 'A match has been found
.
Then: select;f(1,*,g) ="1";end
.
16 ------- - - - - - - - - - - - - - - - -
. If:
.
Then: end
.
17 ------- - - - - - - - - - - - - - - - -
Add @done to your processing table:
if: @ts = "0"
then: MSGBOX 'No Duplicate Record Found"
if:
then: END
Richard Kreiss
GCC Consulting
More information about the Filepro-list
mailing list