programmatically determine whether records exist

Fairlight fairlite at fairlite.com
Mon Feb 16 08:15:20 PST 2015


Hey Ken?

I wrote something external which just reads in every record and checks byte
one of the header.  If it's 0, it's not used, if it's 1, it's used.  It
apparently runs fine, -except- if someone is in the middle of modifying
record #1.

Any clue why that would be?

mark->

On Mon, Feb 16, 2015 at 11:06:25AM -0500, Kenneth Brody thus spoke:
> On 2/14/2015 10:09 PM, Kenneth Brody wrote:
> >On 2/12/2015 7:52 PM, Bob Haussmann wrote:
> >>We are trying to find a way to programmatically determine (i.e., in a batch
> >>file-no user interaction) whether any given filePro database contains one or
> >>more records (Windows environment, fP 5.7).  Our first thought was to use
> >>fpSQL to run a query like the following:
> >[...]
> >>We also thought about checking to see if the size of key/data is zero,
> >>however this wouldn't work if dexpand had been run.
> >
> >NB: This is untested, but "should" work.
> >
> >Make a pair of processing tables:
> >
> >Sort/select:
> >
> >     If: ''' If it gets here, there are records in the file.  Export
> >   Then: ''' some "there are records" value to a file.
> >     If:
> >   Then: exit ''' Make sure to end the code with "exit"
> >
> >Output:
> >
> >@done
> >     If: ''' If it gets here, there are no records in the file.  Export
> >   Then: ''' some "there are no records" value to a file.
> >
> >Run dreport with "-a", and appropriate "-v" and "-fp" flags.
> 
> Actually, there's no need to export anything, simply use "EXIT n"
> and check the exit value.
> 
> Sort/select:
> 
>      If: ''' If it gets here, there are records in the file.
>    Then: exit "0"
> 
> Output:
> 
> @done
>      If: ''' If it gets here, there are no records in the file.
>    Then: exit "1"
> 
> 
> -- 
> Kenneth Brody
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
> 

-- 
Audio panton, cogito singularis.


More information about the Filepro-list mailing list