Enterprise Implicit Assignment error

I’m trying to walk a collection of records and fill them, pulling data from another database

The source database is not shared.
The destination database is shared.

The first “Shape = lvAShape” assignment succeeds
As does the second “«Shape» = lvAShape” succeeds

The next one generates this error:

“Implicit assignment to current cell has been disabled!”

How do I address it?

Code looks like this:

The commented code shows what I’ve tried … to no avail. :frowning:


local lvSrcDB, lvDstDB

lvSrcDB="Inventory_AllShapes"
lvDstDB="Inventory"


select Shape match "" or Shape match " "

firstrecord

lockfields ""

local lvAShape

lvAShape = lookup(lvSrcDB, SKU, SKU, Shape, "", 0 )
Shape = lvAShape

loop
    downrecord
    lvAShape = lookup(lvSrcDB, SKU, SKU, Shape, "", 0 )
    //LockOrStop // makes no difference
    //if error
    //    message "could not unlock record"
    //    stop
    //endif
    //lockfields "" // makes no difference
    «Shape» = lvAShape
    //unlockrecord // makes no difference
while not info("eof") 

Thanks,

– Mark

I don’t see what the problem is in your code. But I can tell you what the error message means, perhaps that will help.

When Panorama first got a scripting language, there were no assignments. Instead of:

Name = "Joe"

you would write:

field Name
"Joe"

In other words, if there was a loose formula hanging around, Panorama would simply calculate it and stuff it into the current cell.

Starting in Panorama 6, this sort of “implicit assignment” is no longer allowed, because it is too prone to error. If you wind up with an extra formula by mistake, it will clobber the data in the current cell, and sometimes that would happen and no one would notice until much later. Very bad. Panorama 6 does have a preference to enable implicit assignment, but I strongly recommend leaving it off. Panorama X does not allow implicit assignment at all.

So what you are looking for is an extra formula that is not connected to an assignment and is not a parameter to a statement.


The problem might be the last line:

while not info("eof")

Panorama 6 can get confused when a formula starts with not, because not is also a keyword. I know it won’t work with an if statement, not sure about while. But you could try changing it to:

while (not info("eof")

or

while info("eof")=false()

Obviously this is rather confusing, and this problem has been cleared up in Panorama X.


One other thing I notice is that you are using the lockfields statement. You probably don’t want to do that. I’m guessing that you are thinking this statement has something to do with record locking, but it doesn’t.

Hey Jim,

Thanks for the quick response.

I solved the problem … by unrolling the loop. That worked fine. (though a bit tedious, since there were 250 records to “fix” … just reran the procedure over and over doing 20 records at a time) :slight_smile:

Since this was just a “one-off”, that wasn’t a problem.

Re: “lockfields” … it does a good job of preventing me to manually modify fields. Hence the thought that I needed to unlock them locally before modification.

Thanks,

– Mark

So I think the while not was indeed the problem.

Just wanted to make sure you were aware that lockfields controls the data sheet user interface, and has nothing to do with the server. It doesn’t affect the server, and it won’t affect the ability of a program to modify a field either. It simply prevents you from double clicking a cell in the data sheet to edit it.

Yes … to both! :smiley:

Thanks, Jim!!

– Mark