Field Names in a Pan 6 DB Import

I am just starting to experiment with the free trial Pan X. However, an odd thing on my first DB import.

I added the .pan extension to the Pan 6 DB, and opened the DB in Pan X. But some (not all) of the field names have an extra space added in front of the field name. Needless to say, procedures which refer to those fields don’t work because the procedure code is lacking the missing space.

Is this a known issue? Should I have done something different before opening the file? Needless to say, the Pan 6 version of this DB is over 10 years old, and has performed flawlessly.

I can duplicate this by placing a space or carriage return at the beginning of the field name in the original Pan 6 file. When converted to Pan X, the space is retained, or the carriage return is converted to a space.

It seems that Pan 6 ignores white space at the beginning of a field name, but Pan X does not.

Hello Dave,

Right on! And on a Sunday too. I had started those field names with a carriage return so that in data view, the headings lined up for all fields – even multi-lined fields.

By the way, Jim, this might be a good addition to Pan X. Have the “Open” command automatically strip leading carriage returns and spaces when opening a Pan 6 DB in Pan X. I cannot imagine a user purposely naming a field with a leading space or return.

This should be an easy change to make (said by someone who knows next to nothing about high-order programming).


It is now!

Panorama X was converting carriage returns in the field name to blanks, as it should, but not stripping them if leading or trailing. I’ve filed a bug report:

As you suggest this will be very easy to fix, and the fix will be included in the next version.

In the meantime, here is a four line program that will strip all leading/trailing whitespace (whether blanks or line breaks) from all of the fields in a Panorama X database, so that you don’t have to do it manually.

local dbfields
dbfields = info("fields")
arrayfilter dbfields,dbfields,cr(),strip(import())
setfieldnames replace(dbfields,cr(),tab())

This could actually be one line program, but it’s Sunday and I don’t feel like bothering!!