1. Weird error message
- Posted by alrobnett Jan 15, 2019
- 927 views
I have a program of about 300 lines which was working perfectly. After making a few minor changes I began getting the following error message between a position() and a puts() statement, which didn't make sense:
"expected a variable, constant or enum, not a function"
I began commenting out successively more and more lines, but always got the same message, just before whatever was commented out.
Restarting the computer made no difference.
In reviewing the program, I found the letter 'e' appended at the end of some lines, scattered in what appears to be a random way through the program. Removing those did not solve the problem.
Do I need to replace the interpreter?
2. Re: Weird error message
- Posted by irv Jan 15, 2019
- 915 views
No. The interpreter does not modify the source code.
Chances are your editor added those E's, either thru some bug or some accident.
Which editor do you use?
3. Re: Weird error message
- Posted by alrobnett Jan 15, 2019
- 887 views
I use wee. But I have some additional information as the result of successive elimination.
integer insert_nmbr object key sequence extracted_files elsif key = 22 then -- ******************* CTRL V INSERT extracted_files = dir("/home/allen/Extracted/") insert_nmbr = 1 -- intervening functional code uses 'insert_nmbr' as a 'while' condition, but commenting all that out made no difference -- -- insert_nmbr = wait_key end if
In the above snippet, I have deleted some commented lines that performed the function of inserting a subtree (immaterial).
If the line 'insert_nmbr = wait_key' is commented out, the problem disappears, in both the abbreviated test program and the full-blown program. The error message is not only not indicative, but appears in very strange places.
4. Re: Weird error message
- Posted by irv Jan 15, 2019
- 909 views
I use wee. But I have some additional information as the result of successive elimination.
integer insert_nmbr object key sequence extracted_files elsif key = 22 then -- ******************* CTRL V INSERT extracted_files = dir("/home/allen/Extracted/") insert_nmbr = 1 -- intervening functional code uses 'insert_nmbr' as a 'while' condition, but commenting all that out made no difference -- -- insert_nmbr = wait_key end if
In the above snippet, I have deleted some commented lines that performed the function of inserting a subtree (immaterial).
If the line 'insert_nmbr = wait_key' is commented out, the problem disappears, in both the abbreviated test program and the full-blown program. The error message is not only not indicative, but appears in very strange places.
wait_key should have parens, since it is a function: i.e.
wait_key()
Have you by chance defined wait_key as a variable somewhere in your program?
5. Re: Weird error message
- Posted by alrobnett Jan 15, 2019
- 931 views
Thanks, Irv. It is fixed now. No, I have not defined it as anything anywhere. I checked with 'Find' to make sure. I am embarrassed about seeing the missing parens; I have used it several times, elsewhere in the program. The error message is usually more helpful. This didn't even point anywhere near the correct line.
6. Re: Weird error message
- Posted by irv Jan 15, 2019
- 917 views
Sometimes, but not always, it is helpful to examine the ex.err file produced when a program fails.
Glad it's now working. Did you find out where those extra e's came from? Or where they went?
7. Re: Weird error message
- Posted by alrobnett Jan 15, 2019
- 922 views
No, and that remains a perplexing mystery. It had nothing to do with the fundamental problem, and didn't exist when the problem first arose. When the 'e''s appeared, the interpreter caught them. I could understand my accidentally dropping one, or maybe even two of them into the code. The intriguing thing about these is that they were widely dispersed, but always at the end of a line of code, never embedded in a line.