[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference ilbbak::ibi_focus

Title:FOCUS, from INFORMATION BUILDERS
Moderator:ZAYIUS::BROUILLETTE
Created:Thu Feb 19 1987
Last Modified:Mon May 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:615
Total number of notes:1779

156.0. "No Records Found Satisfying Criteria" by EFGV01::LEE () Wed Nov 23 1988 09:31

If there are no records satisfying the search criteria when TABLE'ing 
a report, the column headings are printed and then nothing. 

Is there a way of getting FOCUS to explicitly put on the report
the fact that no records were found ? 
T.RTitleUserPersonal
Name
DateLines
156.1&recordsPOBOX::LACEYI don't do syntax, I use RallyTue Dec 06 1988 14:586
    You can reference the value of &RECORDS from the dialog manager.
    If it is zero use -TYPE to print a message. I know this is cludegy
    but I haven't used FOCUS in a few years. I can't think of a way
    to inhibit the headings from being printed in this case.
    
    -Paul
156.2Here's an example of what I useRUTLND::MCMAHONTap dancin' on a landmineTue Dec 27 1988 16:0512
    	Here is what I use in a FEX that lists invoice add-on items.
    	I put it at the end of the .FEX. Hope it helps.
    
-RUN
-IF &LINES EQ 0 GOTO NOLINES ELSE GOTO THEEND;
-NOLINES
-WRITE OFFLINE    INVOICE ADD-ON ITEMS &DATE
-WRITE OFFLINE
-WRITE OFFLINE  THERE ARE NO INVOICES WITH ADD-ON ITEMS 
-RUN
-THEEND  EXIT
156.3No straight pathMEMV03::VOSSWed Feb 01 1989 10:499
    I have spent some time trying to run a report ONLY once and then
    depending on whether there are records found or not, print out a
    message if not or the records if they are found.  But alas, with
    no luck.
    
    The method we currently use is to use the same IF selection on a
    TABLE FILE with IF RECORDLIMIT EQ 1 test. This test will run pretty
    quickly, and then you'll know to run the full report or TYPE/CRTFORM
    a message to the user.
156.4Thank youEFGV01::LEEFri Feb 03 1989 11:1945
Hello,

Thank you for all your responses. Based on what you told us, we did a
couple of experiments. We find that &RECORDS and &LINES can both be
used as described, but that &LINES is generally more useful. 

This is because &RECORDS gives the number of records processed by the
last 'READ-type' operation while &LINES gives the number of records by
the last 'WRITE-type' operation. Thus there's not much difference when
doing a simple TABLE with no selection criteria, but it becomes
significant when doing MATCH's.

For example:

    MATCH FILE x
    ...
    IF selection criteria 1
    RUN
    FILE y
    ...
    IF selection criteria 2
    AFTER MATCH HOLD OLD-OR-NEW
                         ^^

If selection criteria 1 result in some records found, and 
selection criteria 2 result in no records found, then &LINES is
non-zero, but &RECORDS is. ie. &LINES gives the correct result.

Conversely:

    MATCH FILE x
    ...
    IF selection criteria 1
    RUN
    FILE y
    ...
    IF selection criteria 2
    AFTER MATCH HOLD OLD-AND-NEW
                         ^^^

If both selection criteria 1 AND 2 result in some records found, 
but they don't overlap, then &RECORDS is non-zero, but &LINES 
is. Again, &LINES gives the correct result.

Regards to all, Sim & Andr�.