From Jed Cambell (System Enginner, JMP US)
Hi Maria,
Here's a potential code to roast: Eval (), Parse (), and Recursion, an Adventure in Meta-Programming - JMP User Community
Even if I can't be at the meeting, feel free to use it (I'd love to watch the recording, at least). The comments should explain the double-usage of variable names, and I think it would be better to use Expr() instead of Eval(Parse())
Best,
Jed
That can work as a base for roasting script. Jed's script is a "process" on how that script has been built but if we just take the final part that would work (in my opinion).
So this part:
//determine number of parts
New Window ("How many parts?",
<< Modal,
neb = Number Edit Box (10),
Button Box ("OK", numParts = neb << Get;)
);
show(numParts);
listParts = {};
//Build first portion of script for modal window
//Escape character sequence for " is \!"
a = "
New Window(\!"Get Pass/Fail List\!",
<<MODAL></MODAL>
In this script these could be some of the possible "roasting" points:
- No Names Default To Here(1) at the start
- No header for the script
- Missing variable references
- I think user should be able to "exit" already on the first modal window
- Allows for 0, . and negative values for part number (these will just create empty window later, they do not crash the application)
- Variable names are not descriptive
- Using Evil(Parse()) which brings in a lot of different (potential) issues
- Using Text Edit Box when you should only have two options to select (Pass or Fail)
- Combo Box/Radio Box/Check Box would be generally better
- Is Pass good default value? Generally I would set Fail as default value (or even better "empty", "non-selected" to make sure user has made a choice)
- And if we consider this to be JMP18 script (I know it wasn't build for JMP18), I would update modal window to use << Type
- Is it necessary to use lists to collect references and values?
- It isn't but it is easy method
And we don't have the exact purpose for this script. Does it have to have two modal windows? Is it necessary to determine part count before second modal is created or would it be possible to have them in same window OR let user add more by button press. But these could also be considered roasting points? Did you have proper specification before you started working on this? Which problem(s) are being solved?
I can also come up with very basic script that I see often (and I have written something similar when I started). Get data (SQL query, open table, excel ,...), add some formula columns, create summary table and then create window with few reports. And finally save it as interactive .html.