Appending file in Panorama X


#1

How do you append a file to an open database in Panorama X? Pan 6 has options in the Open File dialog box.


#2

The Openfile help page says:
“If this parameter begins with a + symbol, Panorama will append the file to the current database, with the first field appended to the first field, second field appended to second field, etc. If file begins with ++, Panorama will match the field names between the two databases as it appends the data. If a field name does not match, that field will not be appended.”

and

"Note: In Panorama 6 and earlier, the openfile statement was the primary method for opening databases and importing information. For compatibility with older databases, the openfile statement has been retained, but we recommend that for new applications you should use these newer statements:

opendatabase for opening databases.
importdatabase for importing data from another database.
importtext for importing text into the current database.
newdatabase and importtext for creating a new database from a text file.
These statements give you more control, and avoid tricks with the +, & and @ symbols."


#3

I believe he is looking for a way to append, without writing a procedure, and I don’t think that currently exists.

Dave


#4

Dave is right. I’ll wait until Pan X catches up to Pan 6 on appending files.


#5

There’s no way to append without writing a procedure, but keep in mind that the procedure we are talking about is only a single line. Use either the importdatabase statement or the importtext statement.


#6

So, every time I import to the database it is a different file, do I have to modify the procedure every time?


#7

No. If you have to import different files, then you would use the openfiledialog statement in your procedure. You find the documentation in PanoramaX Help.

Here is an example code from the Panorama X Help that would let you append a text file:

local file,folder,type
openfiledialog folder,file,type,“TEXT"
if file=”"
stop /* the user pressed the CANCEL button */
endif
openfile “+”+folderpath(folder)+file