HP Forums
Suppress command output. - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Suppress command output. (/thread-16931.html)



Suppress command output. - t_angenbrandt - 05-13-2021 08:04 AM

Good morning.

Is it possible to suppress command outputs (e.g. like in matlab, where one uses a semicolon at the end of a command)?

The issue is that while working with giant matrices or CAS results from integrals that normally would fill multiple lines on a sheet of paper, the calculator is busy rendering the results instead of doing useful calculation; I am not interested in the outputs of the commands (e.g. I simply store the result of a program function in some variable to work with it).

If there is no way, maybe I can do something like write a function that takes a command, executes it and stores the result in a variable without producing a return value no?

Can I pass a function with all its arguments as an argument like that: suppress(var, func(a,b,c,d,e,f)) or would that not be possible?

Kind regards


RE: Suppress command output. - Albert Chan - 05-13-2021 11:40 AM

zero(x) := 0 Big Grin

Cas> zero(m:=makemat((j,k)->j+k,3,2))       → 0
Cas> zero(m := transpose(m))       → 0
Cas> m       → [[2,3,4],[3,4,5]]


RE: Suppress command output. - t_angenbrandt - 05-13-2021 07:25 PM

(05-13-2021 11:40 AM)Albert Chan Wrote:  zero(x) := 0 Big Grin

Cas> zero(m:=makemat((j,k)->j+k,3,2))       → 0
Cas> zero(m := transpose(m))       → 0
Cas> m       → [[2,3,4],[3,4,5]]

A godsend. Why did I not see this.


RE: Suppress command output. - Albert Chan - 07-16-2021 01:47 AM

XCas suppressing output shortcut ":;" also work in HP Prime emulator.

CAS> m := makemat((j,k)->j+k,3,2) :;       → "Done"