KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Compiler Error: Method is not a Variable and Variable is not a Method
PRODUCT: 4D | VERSION: 18 | PLATFORM: Mac & Win
Published On: November 17, 2020

When running the compiler to check for any issues to preparing to build one of the many possible warnings are:

"The method {Item Name} is not a variable"

and/or the opposite may appear:
"The variable {Item Name} is not a method"

These errors typically occur due to a tokenization issue and typically occurs due to copying a method over with a method that has not been added to the database yet.

For example, if a method is copied over from another that references a method named "myMethod" and "myMethod" is not in the target database yet, the pasted code will tokenize myMethod as a variable. Then "myMethod" is added as a method afterwards.

This is one potential scenario that can cause this issue.

To fix the problem "myMethod" must be retokenized by reentering the method name by deleting and reentering it. An easy way is to copy, clear, and repaste the entire method.