functionvalue
VALUE

The functionvalue statement returns a value calculated by a procedure using the call(, callwithin( or execute( functions.


Parameters

This statement has one parameter:

value – is the text or number to be returned by the call(, callwithin( or execute( function.


Description

The functionvalue statement is designed to be used with the call(, callwithin( or execute( functions. It specifies the value to be returned by that function.

Here is a procedure we are calling wordlist that generates an alphabetical list of words.

local words
words=parameter(1)
arraydeduplicate words,words," "
functionvalue words

In any other procedure or form object in the same database you can invoke this procedure in a formula like this:

local noteWordList
noteWordList=call("","wordlist",Notes)

This example calculates a list of the words in the Notes field. Simply by changing the parameter we can switch to a different field or variable.

MyWords=call("","wordlist",Message)

These examples show usage in a procedure, but you can also use the call(, callwithin( or execute( functions anywhere a formula is allowed, for example within a Text Display Object or a Custom Menu definition. This formula could be used to display a list of lower case words from a text file named Email.txt.

call("","wordlist",lower(fileload("","Email.txt"))) 

Error Messages

Cannot set function result because current procedure is not running from inside a formula. – The functionvalue statement can only be used in a procedure that is running inside a call(, callwithin( or execute( function.


See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0.