Strange execute error

I am trying to streamline my .Initialize routine and I’m running into a bit of a strange error. Here is the entire code:

It checks out ok in the procedure window but wen I run it I get this error message:

I can’t figure out what’s wrong with this simple bit of code.

I’m not sure what the problem is, but I would suggest trying letfileglobal instead of makefileglobals.

The problem appears to be the = sign in “WeekNumber = 1”

The MAKEFILEGLOBALS custom statement contains the statement

arrayfilter «_RawParameters»,code,¬,
    {fileglobal }+array(import(),1,"=")+{ set “}+strip(array(import(),1,"="))+{”,}+array(import(),2,"=")

Since it’s using = as the separator in the array( function, your = is marking the end of the assignment statement. It’s a bug in MakeFileGlobals.

Thanks Jim. Damn bugs anyway! Where’s my can of Raid? The letfileglobal worked but I was hoping to streamline and minimize by utilizing makefileglobals to make a bunch of them. Oh well.

I’m about to run off to the dentist so I didn’t do a deep dive into makefileglobals, but I had a hunch that it might be a bug there. The letfileglobal statement works completely differently, it should work fine for you.

letfileglobal NumberofTeams = superlookup(...)

I would recommend using letfileglobal in any new code, instead of makefileglobals.

I think a simple fix would be to use the arrayrange( function for getting the final value so any included = characters would be included.

arrayfilter «_RawParameters»,code,¬,
  {fileglobal }+array(import(),1,"=")+{ set “}+strip(array(import(),1,"="))+{”,}+arrayrange(import(),2,-1,"=")

I just ran across another problem with makefileglobals. If you try to use it in a .PreInitialize procedure it will make the file unusable. The file will evidently be opened but nothing will show and if you try to use the Open View wizard to open a procedure or form it will give an error message and not open anything. I tried with only one entry in the makefileglobals statement and it showed the same result. I ended up converting my batch of 54 variables from the makefileglobals statement to each using the letfileglobal statement and it worked perfectly.

One additional note: this action is only noticed if there are no other files currently opened when you try to open the file or if you try to open Panorama by double clicking the file in the Finder. If another file is already open in Panorama it will open the file with the makefileglobals in the .PreInitialize procedure without a problem. I thought possibly the set command in the makefileglobals procedure was causing the problem so I simplified the code to

arrayfilter «_RawParameters»,code,¬,{letfileglobal }+import()

but this had no effect on the anomalies. I then thought the execute command might be the problem but that worked fine with other executed code and even commenting that command out of the makefileglobals procedure made no difference. The only other culprit I would suspect would be the «_RawParameters» variable?? :confounded: