PasteCell generates blank error message

In the invoice entry form I described in “Cell highlight obscured by graphic element” I have a procedure that lets me remove an entire line item row by causing the line item row below it to scroll up to fill the line I want to remove, iteratively until all the lines below have moved up. Depending on which line in the list of line items I am trying to remove, the procedure loops as many times as needed depending on how many lines exist below it. This loop calls an internal subroutine that deals with each individual line item field to cause the move. The code is basically like this for each of the 4 line item fields involved:

Field "Order Qty"+NextIndx
CopyCell
Field "Order Qty"+ThisIndx
PasteCell

The local variable values NextIndex and ThisIndex represent the line item number of the next field down and the current field, respectively, with values set in the calling loop. When I run this I get a series of blank dialog boxes with only an OK button. Running in debug mode, I find that the “error” happens each time PasteCell is called. Interestingly enough, the procedure executes my code correctly (including PasteCell), and continues to run, so it’s not exactly an “error” but it requires me to click OK 4 times for each line that has to be moved.

This code is carried over from Pan 6, where it worked without issues.

This doesn’t change the bug report, but those four lines could be replaced with

Set "Order Qty"+ThisIndx, fieldvalue("Order Qty"+NextIndx)

and you wouldn’t have to involve the clipboard at all.

I like it. There is much to learn. Is this syntax new to Pan X or has it been there all along?

fieldvalue( used to be called grabdata(, and two parameters were required. The first parameter was the name of the database, which could be “” if it was the same database, but it had to be there nonetheless. Panorama X makes that first parameter optional, when it’s the same database. You could also use datavalue( instead of fieldvalue(. The only syntax change is the one to fieldvalue(. The rest is the same as Panorama 6.

I was going to make a suggestion along the same lines as Dave did, so thanks Dave. In really old versions of Panorama (like 2 or earlier), there were many tasks that required you to use the clipboard as a variable. This is never required now, and I recommend avoiding it. It’s kind of rude to stomp on the users clipboard like that, and it also is potentially slow.

There is still the question of the pastecell statement. However, I tested this and it worked fine without an error message. So I suspect there is something else causing the empty message dialog in your procedure.

I need to refine my report. The code segment I described originally is only a segment, there are 3 more segments like that following it to deal with the other line items in that row. So a little fuller expression of my code is:

Field "Order Qty"+NextIndx
CopyCell
Field "Order Qty"+ThisIndx
PasteCell

Field "Item Code"+NextIndx
CopyCell
Field "Item Code"+ThisIndx
PasteCell
....

When I step through this code in debug mode, I am at the point where the highlight is on the first PasteCell command. When I click on Step to execute it, I get the blank message, but then I see that the highlight is now on the following CopyCell command, not the ‘Field “Item Code…”’ line which is next after PasteCell. I don’t know what to make of this; there may be a more complex issue at work that has nothing to do with PasteCell itself. The"Field…" line is apparently executed anyway even though it would appear to be out of my control.

To help complicate things, I am seeing the blank dialog message (can’t even be sure it’s an “error” message) in many other places doing other things. But this is pretty simple code that is causing it, if that helps.

I have replaced this code with David’s way more efficient code, so this isn’t a show stopper for me, but the other blank messages remain to annoy. I will try to discover a pattern if there is one.