HP Forums
Debugging using PRINT statements - 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: Debugging using PRINT statements (/thread-11976.html)



Debugging using PRINT statements - BruceH - 12-18-2018 11:15 PM

It's quite useful to sometimes put lines like
Code:
PRINT("Var="+var);
into a program to see what is happening.

This is great except for when var is a list, e.g. {1,2,3}, because then the output is
Code:
{"Var=1","Var=2","Var=3"}

Has anyone found a simple work-around that prints the list as a list? Or even a way of getting PRINT() to not start a new line each time?


RE: Debugging using PRINT statements - Jacob Wall - 12-19-2018 04:07 AM

I think
Code:
PRINT("Var="+STRING(var));
should do it?


RE: Debugging using PRINT statements - Komanguy - 12-20-2018 03:28 PM

(12-19-2018 04:07 AM)Jacob Wall Wrote:  I think
Code:
PRINT("Var="+STRING(var));
should do it?

Yes, of course. It works.


RE: Debugging using PRINT statements - BruceH - 12-21-2018 10:30 AM

Cheers. I thought I'd tried that and got the word "STRING" repeated - must have had a mis-placed double quote. Ooops.