What does the error message 'Invalid object supplied as function' mean?

What does the error message 'Invalid object supplied as function' mean?

book

Article ID: KB0080894

calendar_today

Updated On:

Products Versions
Spotfire S+ All supported versions

Description

When attempting to run code in Spotfire S+ the following error message is given:

'Invalid object supplied as function'

 

Issue/Introduction

What does the error message 'Invalid object supplied as function' mean?

Environment

Product: TIBCO Spotfire S+ Version: All supported versions OS: All supported operating systems --------------------

Resolution

This error message states that Spotfire S+ has encountered something that looks like a function call but it cannot be interpreted correctly.  The most common reason for this is due to the differences between writing equations longhand and coding them in the S+ language.  For example, let's say that you want take 1/2 of (y-x)/x^2.  In longhand you could write:

(1/2)((y-x)/x^2)

The convention that two equations enclosed in parentheses right next to each other is interpreted as multiplication.  In the S+ language, this looks like you are trying to pass arguments to a function called 1/2.  You need to implicitly state that they should be multiplied:

(1/2)*((y-x)/x^2)