This is what is called an “implicit assignment”. You should change this code to:
«8271» = ""
Until I think Panorama 2.0, there was no assignment statement. If code contained text, it would just plop that into the current cell. The problem was that it was easy to do that accidentally, destroying data in the process without even realizing it was happening. For example, consider this code. In Panorama 1 thru 5.5, this code would display the message hello, then put goodbye into the current cell. An easy mistake to make.
message "hello" "goodbye"
So 20 years after the assignment statement was added, I made use of the assignment statement mandatory in Panorama 6. However, many people howled at the necessary code changes, so a preference was added in Panorama 6 to continue to allow implicit assignments for the time being. At that time it was strongly recommended that anyone still using implicit assignments should remove them from their code, and that a future version of Panorama would not support them at all. Panorama X is that version.
Other than the implicit assignment, this code should all work. I just verified that scrapcalc and pastecell work fine. On the other hand, this code would be a lot easier to understand and maintain if it was written in a single line:
InvTotal = InvTotal-lookup("Forms","Form",8271,"Cost","",0)
The oldselect statement is from Panorama 1.x. In those ancient versions, the select statement didn’t use a boolean formula like it does now. To be honest, I don’t remember exactly how the oldselect statement worked, and I don’t have a Panorama 1.0 manual at my fingertips. I did check the Panorama 2 manual just now and it had already changed to the new boolean formula. Off the top of my head, I think oldselect worked like this:
field Name
oldselect contains "Bob"
Which would need to be changed to
select Name contains "Bob"
But I’m not 100% sure on that, I haven’t actually converted any code with oldselect in decades.
I would just remove all saveall statements, and in most cases save statements as well. With the auto-save system used in Panorama X (and most modern Mac apps) explicit saves aren’t usually necessary.
When Panorama 2.0 was released in 1991 (over 30 years ago!) the Panorama programming language got a major overhaul, with the introduction of concepts like assignment statements and variables. Prior to that Panorama 1.x didn’t really have a proper programming language, and coding required all sorts of hacks like using the clipboard, etc. Panorama carried over the ability to use these hacks for a long time, and many of them still work, but if you have code from 1989 that you’ve been using for 30 years, that was a good run but it’s time to make a bit of an investment in updating your code. Believe me, out in the wider programming world there is very little code from 1989 that still runs with zero modifications.