As a safeguard, I frequently start processes with RemoveAllSummaries to be sure there are none left over from some previous operation.

Under the circumstance that there are no data records, an Initialize or other procedure that includes RemoveAllSummaries draws an error message to that effect. It’s hardly a bug, but my preference would be that it just move on.

And yes, I do have files that may be empty when opened before accessing data from related files.

You could follow that with

If error

You may have files that have no data records, but you do not have any files that are empty. Panorama’s algorithms don’t allow a completely empty database with zero records.

That seems like a rather extraordinary circumstance.

It sounds like you are saying that you want it to continue with zero records in the database. But as I mentioned, Panorama doesn’t allow that. There must ALWAYS be at least one visible record.

I think you should probably flag this as an error.

if error
    message "Where's the data??"

Or if an empty database is acceptable, you could do this.

if error

Not making assumptions about “starting conditions” was a learned activity. These days, part of an .Initialize procedure’s job would be to put a database in the desired state - summaries removed, all records selected, fields sorted in the expected order, etc.

I can see the use of an empty database - as the container for the input of imported data - often it would be an intermediary - to pre-manipulate the data - between the raw data and its eventual home in another database.

In the (very) olden days you might get rid of that “shadow” record by importing, then select NotEmpty on a field that would always have imported data, and RemoveUnselected. Yes, very old school. Now I’d just import with Replace.

But what if you want to delete all the records - can’t do that until you add an extra record back in. You could select the added record on its field being empty, then RemoveUnselected and you are back at the start.

For added assurance - because I don’t like to rely on things being “empty” (A space looks a lot like “empty” on my screen), I’d probably put an unusual character in that “shadow” record field and select on then RemoveUnselected.

Or, if it wouldn’t get in the way of your selects and counts, you could just leave it in - not take it out after Import.

I’m certainly aware that Panorama always requires at least one record. It was an unfortunate choice of wording when I referred to an empty database when I was meaning a database with no data; pretty empty.

But I do have more than one instance in which I have a database that may or may not have data in it when first opened. In one case the file is used to process selected sets of text files to create reports. It might have data that was previously loaded, or it might have been emptied - cut down to one record with no data - when it was last closed.

If it has data, there may be summaries to get out of the way as it runs the desired Initialize process to get that data into a proper starting format.

Since RemoveAllSummaries has no ill effect if there are no summaries or if there is no data, it seems to be an unnecessary error message. Much like there’s no error message for SelectAll if there are no records.

That’s all I was trying to express.

If there are no data records it doesn’t just have no ill effect, it has no effect whatsoever. In that situation it just punts and leaves the database as it is, with one or more summary records. So I think what you want is the second solution I proposed, using deleteall if there is an error. That way you are guaranteed to wind up with at least one data record and no summary records.