Form fails to display variable values

I have some very strange behavior going on. I have a form with 53 objects that displays file global variable values (mostly text editors but a few data buttons). A procedure defines the variables and assigns values, then opens the form. But the objects, mostly text editor objects, do not display any thing.

Yikes.

But, then I closed the form, then ran the procedure a second time, and the data appeared!
That seems to be a reliable workaround, having worked several times in a row. Here are screen shots showing the form when first opened, then a re-opened form.

Any thoughts about what is happening?

If the values are defined first, and then the form is opened, the values will be displayed. If the form is already open when the values are assigned, you must use showvariables to make the values appear. Or, closing and re-opening the form will display the values.

I am super confident that Panorama display of variables values works correctly. Perhaps the form was already open, maybe behind another window? That could produce the symptoms you describe.

I am quite sure that it is not working that way in may case.

The code is this:

letfileglobal «fg14052»=array(«140Data»,1)  //140Data is a binary field with a data array
     [do variables 2 to 52 in same format]
letfileglobal «fg14053»=array(«140Data»,53)
openform "Form 140 Data New"

Well, that will work if the form is really closed.

In any case, you could add showvariables statements so that it will work in either case. Try adding this line before the openform statement.

showvariables fg14052,fg14053

Since these variables start with a letter, the chevrons are not necessary (though they don’t hurt anything either). The chevrons are required for the 140Data variable, since the name starts with a number.

One other thing to check – could there be windowglobal variables with these names? In the Form Properties panel check to make sure the Variables option is set to FileGlobal.

The form did have default variables set to global. Not sure how that happened; I never set it to global. I changed that and added a show variables statement before opening the form, and the form now open with the variables showing properly. Why does putting show variables before opening the form work? I had tried using show variables after opening the form, so Im think I see why that did not work: I think PanX automatically created global variables for each object, so the fileglobal variables I created were simply ignored.

Thanks!

If putting showvariables before opening the form made any difference, the form must have already been open in some invisible way, either off the screen or behind other windows.

I forgot that setting the form to Global was even an option. It’s a bad option, I would avoid that whenever possible as then you have to be super careful to avoid problems like this. I think I put this option in for compatibility with legacy Panorama databases, if I was starting from scratch I probably would not even allow this option.

I think it was changing the setting for variables in the form preferences to file global is what made the difference. I dropped the show variables statement and the variables still appear now when I open the form. I didn’t even know that such a setting existed, and I would never have set it to global. Maybe this is an ancient leftover from Pan6; this database was converted from Pan6, well in the past.

But I don’t think I ever would have figured that out, so thank you for that suggestion.

Sounds very likely.

Probably. Panorama X does bring that setting over from Panorama 6 when you convert the database.

I think I’m seeing a related issue.

I have a database that I’ve saved with one form open.
When that database is opened, the form opens.
It contains a TextDisplay field that includes a FileGlobal variable.
That variable is set in the “.Initialize” procedure.

However, the value of the variable is not displayed in the form.

Even if I add a “ShowVariables” call at the end of “.Initialize”

If I

  • close and reopen the form, it updates properly.
  • switch to “graphics” mode, it updates

Any idea what I might be doing incorrectly?

One other point: the TextDisplay is in a “Header” report tile.

TIA!

Are you using Panorama X 10.2? I would expect it to work in that version, but probably not in 10.1.

v10.2.0.b12 (3575)

Oh, and it’s a “View-As-List” form.
Maybe that makes a difference.

Yes, I don’t think showvariables work with variables displayed in the header of a View-as-List form. I don’t think that worked in Panorama 6 either.

Hmm … It looks like it works in Pano6.
I simply moved the database over.