Replace function doesn't recognize ¶ as [return] in the OLD text


#1

I need to replace some line endings with tab in text imported through the clipboard, and the PanX “Replace” function doesn’t seem to recognize the ¶ character as a return. The same procedure worked fine in Pan6.


#2

Chances are the imported text is using line feeds as the line ending, and not carriage returns. It worked in Panorama 6, because the clipboard converted those line feeds to carriage returns, but in Panorama X, they are being left as line feeds.

Use

replace(lftocr(clipboard(),¶,¬)

instead of

replace(clipboard(),¶,¬)

The lftocr( function will ensure that the line endings are carriage returns, before you do the replace.


#3

Or simply:
replace(clipboard(),lf(),¬)


#4

My data apparently did contain linefeeds, and switching to lf() seemed to take care of that problem. My bigger problem now, though, is that that database now crashes the computer whenever I try to open it, so I can’t even look at it to try to see what’s happening. Is there any way of getting Panorama to open an apparently corrupted database?


#5

You could try running a procedure from another database with just openplain as the code. This will call the normal Open dialog except the chosen file will simply open to the datasheet. If this does not work you can always use Time Machine to get an earlier version of the file before the problem showed up. I have done this myself to save a totally mucked up database that I thought I might have lost forever.


#6

Thanks Gary. I was just about to pull a backup version to replace the problem file but I tried openplain and that worked fine. That’s a handy command to know about.


#7

You don’t need to write a procedure with openplain – I’ve already done that for you. Simply use the Find & Open dialog, locate the file, then right click on the file and choose Open Data Sheet Only.


#8

OK Thanks. That’s nice to know.