KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Fixing Compiler Errors: "This function has been called as a procedure"
PRODUCT: 4D | VERSION: 11.4 | PLATFORM: Mac & Win
Published On: September 17, 2009

During the compilation process, the 4D compiler can trow an error such as this:



What does this error mean and how do you fix it? This error occurs when the called 4D command returns a value and the developer does not provide a variable to store it. Double clicking on the error opens the method editor and the offending command is highlighted.

For example, the folllowing code will fail the compilation process. The BLOB to list command returns a list reference and expects a variable to store this reference.

C_BLOB($testBlob)

BLOB to list($testBlob)


To fix this error we need to create a variable which stores the return value from the BLOB to list command.

The code in this example compiles wihtout any errors.

C_BLOB($testBlob)
C_LONGINT($docRef)

$docRef:=BLOB to list($testBlob)