Pan v6 to X DB Conversion Code Problem

I am converting a classic Pan v6 database to Pan X. During initialization of the Pan X version I get an error saying " Execute code contains syntax error: Missing operand".
What is the best way to track down the specific problem?
Jack

Well, I would start by opening the .Initialize procedure and looking for an execute statement.

That’s what I thought too. There don’t happen to be any execute commands in it.
Can you think of any synonym commands which might generate that error?

Is there a call in Initialize that runs another procedure? Have you tried using the View Search wizard to search for “execute”?

It could also be in the code of a custom statement that is used by the .Initialize.

Rather than have us play a guessing game, could you possibly post the .Initialize code here? The best way to do that is to select the code, choose Copy Indented Code from the Source menu, then paste it here.

Also, if you temporarily rename the .Initialize procedure to something else, or just put a return statement at the top, does that stop the error?

I should have said that there a couple of calls in my .initialize but they do not lead to any execute statement.
The view search only turns up one execute which is contained in a comment.

Yes – Renaming the procedure does eliminate the error message>

Following is the procedure code:
NOTE: I have no idea why this content is partially enlarged with a bold font.

================================================
/Initialize/

If info(“DatabaseName”) beginswith “??” // This will trap .Initialize in the event of a problem in it.
OpenProcedure “.Initialize”
Stop
Endif

Permanent pvTop1,pvLeft1,pvHeight1,pvWidth1
pvTop1=31
pvLeft1=10
pvHeight1=320
pvWidth1=530

Global vCurrWindow,vLastWindow,vContenta,vContentb,vContentTotal
vLastWindow=“No Change”
vCurrWindow=info(“formname”)
vContenta=“?”
vContentb=“?”
vContentTotal=“?”

// If Window Positions are not saved…
If Info(“formname”)=“”
Setwindow 2000,2000,20,20,“”
OpenForm “htfo”
//SetWindow pvTop1,pvLeft1,pvHeight1,pvWidth1,“NoPalette NoHorzScroll” ;Bottom""
SetWindow pvTop1,pvLeft1,pvHeight1,pvWidth1,“”
OpenForm “View As List”
else
Setwindow 2000,2000,20,20,“”
OpenForm “htfo”
SetWindow pvTop1,pvLeft1,pvHeight1,pvWidth1,“”
OpenForm “View As List”
endif
Show
save

NoShow
Makeglobals vSel=0,//vVer=Info(“Version”),//vUd=«Updated»
assign vSel=“0”
vVer = Info(“Version”)
SelectAll
Field «Updated»
Maximum
vUd=«Updated»
WindowBox “100 125 175 385”
OpenDialog “Opening Message-1”
loop
Until 2000
Show
NoShow
RemoveSummaries 1
Select asc(Category) ≠ 80 ;80=P
Call “.ExportBusiness”
Call “.ExportNames”
GoForm “Opening Message-2”
show
Loop
FirstRecord
Until 2000
CloseWindow

Thanks,
Jack

I think the error message is caused by the line with makeglobals. You’ve commented out part of the line, but what’s left uncommented is not a valid statement. This is not valid in Panorama 6 either. The reason why the error message mentions “execute” is because internally, the makeglobals statement uses execute to create the variables.

However, why did you try to comment out part of the line? You are using these variables later in the program, you need them. So that’s another problem. I think you want to remove all of the // in that line.

Actually, the makeglobals statement is kind of obsolete. I would recommend using letglobal instead, like this

letglobal vSel = "0"
letglobal vVer = info("version")
letglobal vUd = Updated

Also, you could now replace:

SelectAll
Field Updated
Maximum
vUd = Updated

with:

letglobal vUD = aggregate({Updated},"maximum")

Then you could also remove the removesummaries statement.

What are all of these variables for? Maybe they are used by the two subroutines you call later? I think they probably don’t need to be globals, it would be much better if they were fileglobals. Then they would have no chance of interfering with any other database on your computer. Never use a global unless you absolutely have to.


I think the line Select asc(Category) ≠ 80 would be much clearer if you used

select Category beginswith "P"

This does the same thing, but will be much less mysterious when you are trying to figure out what the code does in another year or two. Actually I still think this is mysterious, why on earth would you want to select only categories beginning with p each time you opened the database? I suppose you must have a reason.


Your code that checks for a database name that beings with ?? is now unnecessary - instead you should use the diagnostic mode available in Panorama X.

You should NEVER use the stop statement in .Initialize code - it interferes with Panorama’s initialization of the database. However, there is good news, actually now Panorama will handle this as an error, and it won’t interfere with initialization. But now you’ll know why you are seeing an error message.


I think you should get rid of all of the code that checks what the window is and possibly opens a form. The Database Options window now has a simple option that allows you to set this up.

I also think it is a super bad idea to open a dialog box in the initialization code. It’s just poor user interface design. However, I think in the current version of Panorama X it might work. It definitely did not work in earlier versions of Panorama X.

If you decide that you must still have the dialog, there are a couple of places where you loop 2000 times to cause a delay. The delay is probably going to be much less time than you think because Panorama is a lot faster than it used to be. However, there is now a delay statement that allows you to specify a fixed delay that will be the same time no matter what the performance of your machine is.


My suggestion to use Copy Indented Code would have prevented this.

Thank you Jim.
BTW, is there a way I can avoid having to log in to the Discussion Forum each time that I want to refer to it?
Jack

Depends on what browser you are using. Many web browsers have a preference setting that allows storing the user name and password for specific sites. But you also have a setting that tells your browser to forget everything after a session is over (when you close the browser). So review your browser preferences.

As Shakespeare once said, “The fault, dear Brutus, is not in our stars, But in ourselves, that we are underlings”. I think what he meant was, your web browser behaves the way you set it up.

Don’t log out?

What do you mean by “each time”? Once per day? per hour? Every time when you haven’t been on the forum for a couple of months?

Normally, you should not have to log in every time. Your browser uses a feature called “cookies” to remember your login information. As Paul mentioned, the browser will not remember these cookies forever. But usually the browser will remember for at least a few weeks. If it is forgetting sooner than that, you’ll need to look into your browser preferences as Paul mentioned.

If you use Safari’s “Private Window” feature, I think that would cause it to forget immediately as soon as you close the window. So don’t use that feature if you don’t want to have to log in every time.

Safari also has a “block all cookies” preference. If that option is enabled, you would have to log in every time.

I just ran across this blog post (it’s only a couple of days old) that explains why Safari logs you off after a period of time, which may be 7 or 30 days, depending on how the web site keeps track of the logon.

According to this article, Chrome and Firefox do not exhibit this behavior.