Unknown Identifier error message

I have recently added a new table to my app, and for some reason existing code is now generating an unknown identifier error message:

Capture1

Here is a typical example: “Unknown identifier: ERRORSTR”

The compiler used to compile this code without any problems. The new table doesn’t have a field of that name, so I’m stumped. How to proceed, other than comment out the line in question and not display the error message in the field called “response”?

Please help!

Look closely at the generated code, and the line number and COLUMN number of the errors.
are there additional errors that come after the one you’re talking about ?
IOW, is there a problem with the class or method itself vs. the line in the class.

where do you declare “response” ?

Is errorStr a StringTheory object?

I agree with Mark, show us the full error listing. Also, open the module for the procedure and show us the error trap method.

nevermind, I see the prototype is a STRING.

Response is a text field in the form, as is WMStatusMessage and EstimateTime. If I change the faulty line to

Response = ’ ’

it compiles without any issues.

I don’t understand why the errorStr string has been defined and used in previous lines but causes an error in column 21 of the highlighted line:

response = CLIP(errorStr)

The other weird thing is it says the error is in line 704, but shows line 3378. Line 704 is a comment, and errorStr is nowhere near it. Commenting out line 3378 causes the error to go away.

The parent.errortrap method is somewhere in the NetTalk 12 code.

Don,
You’re looking at the code in the embeditor. So the line numbers there are different to the CLW.
When it looks wrong, it likely is, because the Errors-pad-click does not always take you to the right place.

Check the name of the CLW in the Errors pad. Open that CLW. Go to the reported line number.
What code do you see there?
That’s the code with the bug in it.

Cheers
Bruce

Thanks. What puzzles me is the CLW file is 64,456 bytes but if I open the embeditor, select all, copy and paste the code into a separate text file, it is 186,861 bytes

The erroneous piece of code in the CLW file seems to be randomly placed there.

No wonder the compiler doesn’t like it!

Unknown identifier: ERRORSTR - F:\dev\wmSage\wmSage008.clw:704,21

wmSage008.clw (62.9 KB)
wmsage008.txt (182.5 KB)

I have uploaded both files. I think I must have broken something when I moved this project from NT11 to NT12. I will report back after reinstalling.

I did a fresh install of C11PE 11.1.13815 and all my CapeSoft libraries, plus other third party stuff. The problem didn’t go away. So I compared wmSage008.clw with an old copy from a backup.

It turns out that the code generator dropped the definition of ErrorTrap from the “ThisWebClient” Class definition, even though it is present in the Embeditor code. So I went to the Local Objects embed point and added three comments: One in the data definition, and one each before and after the parent call code.

Capture2

Now the ErrorTrap procedure code is correctly generated in the CLW file, where it wasn’t being generated properly before.

Weird. Thanks everyone for your help.

The size difference can is due to the embeditor shows many comments that are NOT generated into the .CLW For example looking at the screen shot of your original post we see things like

! Start of "NetTalk Method Data Section"
! [Priority 5000]

Remember how I said to look at the GENERATED Code (and not the embeditor)
that’s because the compiler uses the generated .clw and the line numbers refer to lines in the .CLW not to the embeditor.

The compiler can lose context and complain about unknown labels when the procedure you’re in is wrong itself (or one above it in the same module). Which is why I asked if there is a problem with the class or method itself.

From just the screen shot, we could see the parameter of errorStr, so it should be known - which is why it was likely that there was a problem of “context” - which is to say problems with this class, this method, or ones above this part of the code.

2 Likes

It also includes every Method and every Embed while the Generated .clw usually only has filled Methods and Embeds (using Template #SUSPEND).

The “Generated .CLW” is also know as the “Module .CLW”.

It can be viewed by right clicking on the Procedure and selecting “Module”. That will open the Module in the regular Editor. Don’t make changes to it as they will be lost next build.

With the Module open in the Editor you can jump to the Line Number specified in the Error Message and see the code that the compiler is building. I have run into the IDE not generating the Module so its code does not match what I see in the Embeditor. Very confusing, the only way to know is look at both. I get tipped off then I fix problem code but it keeps showing the error.

One other “Generated .CLW” difference is the Embeditor has ONE Procedure, but the “Module .CLW” can have multiple. I like to put related files in the same Module, e.g. Invoice Header Browse and Form, plus the Details Form.

2 Likes