Message Boards Message Boards

0
|
4277 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

Show calculation steps in FormPage?

Posted 8 years ago

I deploy my function in cloud with this command

CloudDeploy[
 FormPage[{"one"-> "String", "two" -> "String"}, 
  myFunction[#one, #two] &], Permissions -> "Public"]

myFunction[in1_, in2_] :=
 Module[{a, a1, a2, b, b1, b2, b3, b4, b5, result = {}},
  ...some computations...
  result
  ]

As a result I get this form page FormPage


The question is how can I print the steps of myFunction on the webpage? Just giving the final result doesn't give much information.

Using Print command doesn't give m the desired result.

Your function "myFunction" only returns "result" and so "result" is the only thing that will be displayed on the page.

Instead, you probably want it to return a formatted list of outputs:

myFunction[in1_, in2_] :=
 Module[{a, a1, a2, b, b1, b2, b3, b4, b5, result = {}},
  ...some computations...
  Column[{something , somethingelse , result}]
  ]

Print will not work. Beginning programmers should basically just never use Print. It is easily misunderstood. Print doesn't return anything. It just causes a side effect which here isn't visible.

POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract