Simple Pan 6 procedure doesn't run in Pan X


#1

Field Date
copycell
Select Date=>clipboard()
RemoveSummaries "7"
field Mileage
Total

Why would this not work in Pan X. What am I missing?


#2

Replace the first three lines of your program with these two lines and it will work.

let xdate = Date
Select Date=>xdate

Apparently Panorama 6 had some special code that would allow numeric and date values to be stored in the clipboard as numeric or date values. In Panorama X, the clipboard can only contain text.

In any case, I strongly discourage use of the clipboard as a variable. You had to do that in Panorama 1, but from any time from Panorama 2 on, using an actual variable is a much better way to go.


#3

Thank you for explaining this to me. Old habits die hard. I put this together and it works as it did in Pan 6.

let xdate=""
Field Date
copycell
xdate=Date
Select Date=>xdate
RemoveSummaries "7"
field Mileage
Total


#4

You have 3 unnecessary statements there. The procedure Jim was suggesting was,

let xdate=Date
Select Date=>xdate
RemoveSummaries 7
Field Mileage
Total

It doesn’t matter which field is active when you do the Select. The Total command and CopyCell are the only commands that care which field is active. Unless you plan to be pasting that date somewhere after the procedure finishes, there is no need for the CopyCell, and if the value that is currently on the clipboard is ever one you still have a use for, the CopyCell will destroy it.


#5

Ha, see how an old dog has trouble learning new tricks. Thank you Dave…