Showvariables deleting value?


#1

I thought This may be a fileglogal scope problem, but just tried with a local variable and same problem.

I have a popup button with a list created by a variable that returns the data fgConcChoice and calls a procedure
I have a text display object which shows the variable fgProgress.

I’ve stripped the procedure down to this trying to find the problem:

fgProgress=array(fgConcChoice,2,":") showvariables fgProgress

fgProgress=fgConcChoice showvariables fgProgress

stop

When I run this the first statement returns the correct result, while the second returns empty.

Reverse the order of the statement, the new first statement returns the correct result and the new second returns empty.

Is this expected behavior?

Thanks
Martin


#2

showvariables doesn’t delete or change any value. Full stop.

Perhaps fcConcChoice contains carriage returns, and the first line is empty? If your Text Display object only displays the first line, that could explain what you are seeing. But I can absolutely for sure tell you that showvariables is not changing the value of your variable.


#3

Ok, just had a power failure. Rebooted and tried again and it worked just as it is supposed to. I’ve been getting the described result for several days. Ghost in the machine?


#4

Ok, back at it again and the problem continues with a new variation.

/// here’s the procedure
;fileglobal fgConcChoice
;fgConcChoice=“999:Test”

fgProgress=""

fgProgress=fgConcChoice showvariables fgProgress ; formulaTest1
displaydata fgProgress

fgProgress=array(fgConcChoice,2,":") showvariables fgProgress ; formulaTest2
displaydata fgProgress

stop
///

Commenting out the fileglobal definition for the purposes testing the popup menu.

The popup menu is set to “formula” the formula is a variable created by an arrayselectedbuild which creates a cr() separated list in the form of “IdNum:ItemName”. The first line is NOT empty.

One item chosen at a time, many different choices tried.

Have added displaydata instead of relying on the TDO.

Selecting an item at random from the popup,(“655:Goobers Small”) the first text display window shows “655:Goobers” and the second displays blank.

If I switch the first statement (formulaTest1) and the second statement (formulaTest2) the first displaydata window shows “Goobers Small” and the second displays blank.

This is basically where I was at the first post.

If I comment out “showvariables fgProgress” (with “;”) from both statements, then the results are as expected, ie: 655:Goobers followed by Goobers Small.

BUT…if I go back and remove the “;” so “showvariables fgProgress” is back in, then it runs as expected, second displaydata is no longer blank.

BUT…remembering the problem went away after a power failure, I quit and restarted PanX. And the problem returns.

Comment out “showvariables fgProgress”, all works right.
Un-comment them in, all works right.

Is there some sort of variable I could be creating elsewhere that is clashing? I use fgProgress alot. I tried changing it to fgProgressx but got the same results.

Also tried changing to popup to a CSV with some test data typed in, same results.

As for the final clue, you can see commented out above, I tried defining fgConcChoice without the popup menu. When I run the procedure without the popup, it works correctly every time. Switch back to the popup and the problem returns.
FWIW: using // instead of ; produces the same results.

This is all on my home mac using El Capitain. I have not tried it on my work Mac with High Sierra.


#5

What is the popup menu formula? Does the formula contain fgProgress? If so you have created a “feedback loop” which would cause the problem. It definitely sounds like the problem has something to do with the popup menu object, not the code.


#6

The popup menu formula is just a variable: fgArConcList. Does not contain fgProgress

Just tried it at work with High Sierra. The problem persists, but commenting out the “show variables fgProgress” does NOT correct the problem. Haven’t tried quitting PanX yet. Works properly with the hard entered test data. does not work with the CSV test.
Popup seems to be looking more likely as the problem.


#7

Continuing using High Sierra…

Re-associated the popup with the procedure from which it originally came.

Commented out all of the “showvariables fgProgress” in the procedure

The popup value (fgConcChoice) persisted through the procedure, and the procedure worked fine.

Added back in “fgProgress=”" showvariables fgProgress" at the top of the procedure.
The value of fgConcChoice was blank (as per displaydata) on the first line after and throughout the procedure.
commenting out “showvariables fgProgress” and the value maintained throughout the procedure.

Then I tried this:

displaydata fgConcChoice

fgProgress="" showvariables fgProgress

displaydata fgConcChoice

The value of fgConcChoice persists through the complete procedure.
If I comment out the first displaydata, and leave the showvariables active, the value of fgConcChoice is blank in the seconde displaydata

Could there be some display related bug?

EDIT: May have found it.

I had TextList in another form also called fgConcChoice. Changed the popup selection variable to fgConcChoice2 and so far everything is working correctly.

Discovered this because a different popup was returning information from the TextList, even though there are no variables in common (the second popup is just a list of years, the TextList is an item inventory list).

I’ll keep an eye on it and see if I’m right.