Script Function Reference

Function Reference >Script Function Reference >Table Formats>function

Function

The function format is a table representing a function in the calculator. Generally, the function format is to be used to retrieve function information only.
x.type = "function"
x.name -- a string with the name of the function
x.fntype -- a string representing the type of the function the possible values are listed below
x.params -- a string with the parameters for the function
x.color -- the color of the function in a color format This only applies to graphable functions
x.interval -- an array of values in an interval format. The size of the array is equal to the number of parameters.
x.fnptr -- a value used to represent the function for the calculator, do not change this value
The possible values for fntype are:
  • "user"
  • "xy"
  • "polar"
  • "para2d"
  • "xyz"
  • "para3d"
  • "2dplot"
Here is an example using the function format.
function printInfo(function)
  outputString(x.name .. "\n")
  outputString(x.fntype .. "\n")
  outputString(x.params .. "\n")
  outputString(x.color.r .. ", " .. x.color.g .. ", " .. x.color.b .."\n")
  for i = 1,#x.interval do
    outputString(x.interval[i].min .. ", " .. x.interval[i].max .. ", " .. x.interval[i].res .."\n")
  end
end