Variable Cell assignment

I am sure I’m missing something, but neither of these work (and must)

Cell formula (or value)
«» = formula (or value)

neither produce any result and appear to be ignored. Cell contains starting value.

Both of these forms of assignment work just fine. As you say, you are probably missing something, but since you’ve provided no detail as to what you are actually doing it’s not really possible to assist you. But these assignment methods do work just fine.

I’m wondering what the heck you mean by this. Cell is the name of a statement. Have you also given a field the name Cell?

Sorry, I just have not been able to get Cell formula to work in any of my converted P6 databases.
An example: I have a database with weekly columns labeled Wk## for each week thru the current week. I have procedures that can access any of the weekly columns without issue. The problem arises when I attempt to modify the contents of a cell (add, subtract or change) using Cell formula or «»= formula.

these lines work and assignment can be variable
lxCt= “Wk36”
Field (lxCt)

none of these produce a result, the cell is still blank
Cell 2
Cell «»+5

I have tried these with a new database and they work. It seems that there is something about converting from P6 that introduced this problem.

On the lines you say work, you’re assigning lxCt a text value of “Wk36”, not the value from a field named Wk36. Then you’re activating the lxCt field. There’s nothing similar in the lines you say don’t work.

In the first two to those, you’re using what are known as implicit assignments. They don’t work in Pan X. There’s good explanation of this by Jim Rea at Converting old procedures to Pano X - #4 by admin

The third assigns a numeric value to the current field. It would have to be a numeric field in order to accept it, but do you know you have the correct field activated?

The fourth is assigning the value of the current field plus five to a field named Wk34. Both Wk34 and the current field need to be numeric.

If they’re not working, how so? They run and nothing at all happens? If there are error messages, you should share them because they offer significant clues.

I am assigning the text value “Wk36” to lxCt, not the cell value, then activating. The field Wk36 is an integer field (I have tried floating, same result).

lxCt= info(“fieldname”) ; Wk36 in this example
Field (lxCt)
message lxCt ; message: Wk36
«»=7 ; nothing happens to field Wk36, or any other field
message «» ; message: 0

If I change to:
Field Wk36
«»=7 ; field remains blank (or no change to previous value
message «» ; message: 0

It does move to the correct field and cell
No error messages are produced

This is all working correctly for me. I took a Panorama 6 database that I use for testing, and changed one of the field names to Wk36, which was an integer field. In my test procedure, I wrote

Local lxCt
lxCt= “Wk36”
Field (lxCt)

Cell 2

When I opened the database in Panorama X, and ran the procedure, Wk36 became the active field, and it was assigned a value of 2. Repeating the process with «»=7 also produced the desired result.

You’re doling out clues little by little. Apparently lxCT is a variable. I could have deduced that earlier but overlooked the fact since it wasn’t assigned as such in your example. How are you creating the variable and is it a local, file global…? Is there possibly a second variable or a field by the same name?

A good starting point would be to see if you can simply enter a value into one of your week fields without using any calculated field names.

Does Wk36 = 7 produce a result? If it’s a numeric field it should.

If that works, how about assign Wk36,7?

And if that much works, how about with set?

Let lxCt = “Wk36”
Set lxCt,7

I tried the Set function and that initally appears to work

When this thread started I thought it seemed ridiculous. I had used «»= a few weeks ago in the procedure that arose out of this thread about the choices palette a few weeks ago. I subsequently incorporated that procedure into a much larger, older database and all worked fine.

However, yesterday I imported that same procedure, which creates a menu to replace the choices palette for a field of type Choices, into a new database I’ve started this week, and it wouldn’t assign a value to the current cell. I replaced «»=something with cell something but that made no difference. Having recently read this thread, I was prompted to try set info("fieldname"),something instead and that worked, but I can’t find any difference between the two databases to explain why the other two do not. The procedure was copied in toto to the new database and the fields that call it are configured in exactly the same way. It’s all very strange. However, it all works well enough using set info("fieldname"), so I have given up investigating for the time being.