Message Boards Message Boards

Cloud Deploy a FormFunction

Posted 10 years ago


I am trying to deploy a form function that takes two numbers, a basis and an exponent, and computes basis^exponent.

 FormFunction[{"basis" -> "Number", "exponent" -> "Number"}, 
  f[basis, exponent]]]

The output for 3 and 2 is (basis^exponent)[<|"basis" -> 3, "exponent" -> 2|>] instead of 9.

Any hints?


POSTED BY: Radu Matei
Posted 10 years ago

seems you just copied the lines somewhere and don't know what f means here.
well, it should be a pure funtion object, please reference to ref/Function

 FormFunction[{"basis" -> <|"Interpreter" -> "Number", "Input" :> 3|>,
    "exponent" -> <|"Interpreter" -> "Number", "Input" :> 2|>}, 
  #basis^#exponent &, 
  AppearanceRules -> <|"Title" -> "demo power function", 
    "Description" -> "Enter two number as prompted below"|>, 
  FormTheme -> "Red"]]

good luck.

POSTED BY: wayne wang
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract