1

yeah, so can i do that?

i have a program already written that has two functions.. and one is recursive.. so i want to know how can i execute just one line of code at a time by pressing a button.. i hope it's possible

and also i'm doing this in a web page

this is my script.. it has no importance but just for you to make an idea..

READ THIS... i don't want to debug it with firebug or whatever... i want to make this myself inside my program... i want to make the code execute 1 line at a time when i press a button..so basically im building my own debugger.. the graphical part is already done.. i only need to know how to do this..

                        function nod(){
                            var info;
                            var st;
                            var dr;
                        }
                        function help(){
                            var rad;
                        }

                        var h = new help();
                        h.rad = new nod();
                        h.rad = null;

                        function create(h,x)
                        {

                            if(h.rad==null)
                            {
                                h.rad = new nod();
                                h.rad.info = x ;
                                h.rad.st = h.rad.dr = null;
                            }
                            else{
                                if(x < h.rad.info){
                                    var h1;
                                    h1 = new help();
                                    h1.rad = h.rad.st;
                                    create(h1,x);
                                    h.rad.st = h1.rad;
                                }
                                else{ 
                                    var h2;
                                    h2 = new help();
                                    h2.rad = h.rad.dr;
                                    create(h2,x);
                                    h.rad.dr = h2.rad;
                                }
                            }


                        }

                        function read(h)
                        {


                            var input = [0,10,2,1,8,9,4,5,3,6,20,11,30,21,31,22,23,
                            ];
                            var i;
                            for(i=1;i<=16;i++)
                            {
                                create(h,input[i]);

                            }



                        }

                        read(h);
Matt
  • 51
  • 1
  • 4
  • 1
    Open your site in Chrome and use the [integrated script debugger](https://developers.google.com/chrome-developer-tools/) to execute the script step by step after a breakpoint you set. – Denys Séguret Jun 20 '12 at 13:55
  • 1
    My guess is you should take a look at Firebug breakpoints. But that really is just a guess. – Graham Jun 20 '12 at 13:56
  • @Matt You are essentially making a debugger, hence all of the people saying to use the built in ones. The closest I could get you is: http://stackoverflow.com/a/3969760/1276124 – Ryan B Jun 20 '12 at 14:44

1 Answers1

1

Open your site in Chrome and use the integrated script debugger to execute the script step by step after a breakpoint you set.

But have at least a quick look at the whole box of tools I linked too to ensure you know what you can expect and use the best tool for your need.

Denys Séguret
  • 372,613
  • 87
  • 782
  • 758
  • you don't understand i don't want that... i want to make this myself inside the project.. i need to make the code execute line by lline – Matt Jun 20 '12 at 14:20