The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

Prime: Debug with Parameters
Message #1 Posted by Helge Gabert on 3 Oct 2013, 11:33 a.m.

I have a program that expects a vector as a parameter, e.g.,

MYPROGRAM(a)
BEGIN
...
END;

(a is a vector)

I'm wondering how to debug or run my program from the Program Catalog, because the Program Parameter screen which pops up doesn't appear to allow vectors or matrices to be input.

The program runs fine from the command line with the vector as an argument.

      
Re: Prime: Debug with Parameters
Message #2 Posted by Han on 3 Oct 2013, 11:57 a.m.,
in response to message #1 by Helge Gabert

Quote:
I have a program that expects a vector as a parameter, e.g.,

MYPROGRAM(a)
BEGIN
...
END;

(a is a vector)

I'm wondering how to debug or run my program from the Program Catalog, because the Program Parameter screen which pops up doesn't appear to allow vectors or matrices to be input.

The program runs fine from the command line with the vector as an argument.


Try:

DEBUG(MYPROGRAM([a,b,c]))
            
Re: Prime: Debug with Parameters
Message #3 Posted by Helge Gabert on 3 Oct 2013, 12:17 p.m.,
in response to message #2 by Han

Thanks, Han,

But that doesn't give me the Debug stepping screen for single-stepping through the program. It only runs it (same as MYPROGRAM([a,b,c]).

                  
Re: Prime: Debug with Parameters
Message #4 Posted by Han on 3 Oct 2013, 12:26 p.m.,
in response to message #3 by Helge Gabert

Quote:
Thanks, Han,

But that doesn't give me the Debug stepping screen for single-stepping through the program. It only runs it (same as MYPROGRAM([a,b,c]).


Did you put any

halt();
commands in the program? I believe it works the same way as the HP48-HP50 in that DEBUG only brings up the interactive debugging interface if you use a halt.
                        
Re: Prime: Debug with Parameters
Message #5 Posted by Helge Gabert on 3 Oct 2013, 12:46 p.m.,
in response to message #4 by Han

Actually, DEBUG works even without the halt(); in HOME view, though!

I was in CAS view - - there, DEBUG does not seem to have an effect.

                              
Re: Prime: Debug with Parameters
Message #6 Posted by Han on 3 Oct 2013, 12:52 p.m.,
in response to message #5 by Helge Gabert

Even with halts() placed in it still doesn't work in CAS mode? (I myself have not tried it.) I wonder if CAS programs can be debugged in CAS mode...

                                    
Re: Prime: Debug with Parameters
Message #7 Posted by Helge Gabert on 3 Oct 2013, 1:05 p.m.,
in response to message #6 by Han

Yes that is correct. I does not work, even with halt().

Perhaps they can be debugged if they are parsed within CAS when developed (I just wrote my prgram the "normal" way, in the HOME environment).

      
Re: Prime: Debug with Parameters
Message #8 Posted by cyrille de Brébisson on 4 Oct 2013, 2:01 a.m.,
in response to message #1 by Helge Gabert

Hello,

sorry, can't do it as you want, however, there is a serie of workaround:

in home, do debug(myprogram(params)) in your program, place a single debug; instruction where you want debuging to start (it's a breakpoint basicaly)...

these should allow you to fix the bugs that you might have...

cyrille

            
Re: Prime: Debug with Parameters
Message #9 Posted by Helge Gabert on 6 Oct 2013, 7:26 p.m.,
in response to message #8 by cyrille de Brébisson

Thank you - - that works!


[ Return to Index | Top of Index ]

Go back to the main exhibit hall