Search code examples
openedgeprogress-4gl

Why can't I open a *.w file in the appBuilder?


I have a *.w file, referring to two include files ({incl\include_file.i}, {incl\do_something_file.i}). That first include-file contains the definition of a RECID variable "recordid":

  DEF INPUT-OUTPUT PARAMETER recordid      AS RECID.

I am capable to compile the *.w file, the listing file looks as follows: (just a fragment)

Prompt>findstr "recordid do_something" listing.txt
...
 1    x       DEF INPUT-OUTPUT PARAMETER recordid      AS RECID.
...
 1    x   1   {incl\do_something_file.i
 2    x   1 INPUT-OUTPUT recordid

So, the compilation works. In top of that, I've checked the pairs of "&ANALYZE-SUSPEND" and "&ANALYZE-RESUME" clauses and everything is fine.

Nevertheless, I can't open the *.w file, as the mentioned RECID seems not to be known (errors 201 and 196).

Edit after first comments This the exact error message I get while opening the *.w file, using the AppBuilder (I'm working with a Dutch version of the tool, hence the Dutch words in between):

---------------------------
Fout
---------------------------
This file cannot be analyzed  by the AppBuilder. 
Please check these problems in your file or environment: 

** Onbekende veld- of variabelenaam - recordid. (201)
** .\incl\<do_something_file>.i Compilatiefout op regel 7. (196)
---------------------------
OK   
---------------------------

Edit with more information on ANALYZE- clauses I've launched following findstr command on my code with the following results:

Prompt>findstr /I "ANALYZE-RESUME ANALYZE-SUSPEND" <filename>.w
&ANALYZE-SUSPEND _VERSION-NUMBER ... GUI
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS ...
&ANALYZE-RESUME
...

I confirm that the number of &ANALYZE-SUSPEND clauses equals the number of &ANALYZE-RESUME clauses, they are in the right sequence (first a SUSPEND and then a RESUME) and none of them is commented out.

Does anybody have an idea what's going wrong?


Solution

  • The problem was caused by an include, being outside of an suspend resume clause, in order to solve such a situation the following command might be useful:

    findstr /I "ANALYZE {incl" <source_file>.w
    

    The result should look like the following:

    ...
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL C-Win
    &ANALYZE-RESUME
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK C-Win
    {incl\something.i}
    {incl\something_else.i}
    &ANALYZE-RESUME
    ...
    

    You see following rules:

    1. The number of suspends and resumes must be equal.
    2. Every suspend is to be closed by a resume.
    3. Not one of those can be commented out.
    4. It is advised to have includes between the suspend and the resume.