Debug window of sorts?

View: New views
5 Messages — Rating Filter:   Alert me  

Debug window of sorts?

by Michael Check :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Do you all have any reccomendations for a working environment where we
can keep an eye on form variables and such.  I'm getting a little more
than frustrated trying to figure out if what is in the _form
collection is actually there.

We're using fusebox so placing dump code in the switch is an option,
just not very elegany to have to turn it on and off all the time.

Maybe something that would pass the post the $attributes, _form  to
another window?  Or a floaty javascript thingy?

Or post every call to the session?

Looking for suggestions for how you all work with it.

Thanks,

Michael Check
_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Re: Debug window of sorts?

by aparajita :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Do you all have any reccomendations for a working environment where we
> can keep an eye on form variables and such.  I'm getting a little more
> than frustrated trying to figure out if what is in the _form
> collection is actually there.
>
> We're using fusebox so placing dump code in the switch is an option,
> just not very elegany to have to turn it on and off all the time.

Have you tried a4d.console.dump form variables? You could put it in  
the On Execute Start event handler, and have a global switch to turn  
it on or off, like this:

if (<>gDebugPost)
    a4d.console.dump form variables
end if

Regards,

    Aparajita
    www.aparajitaworld.com

    "If you dare to fail, you are bound to succeed."
    - Sri Chinmoy   |   www.srichinmoy.org


_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Re: Debug window of sorts?

by CDonahue :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Do you all have any reccomendations for a working environment where we
> can keep an eye on form variables and such.  I'm getting a little more
> than frustrated trying to figure out if what is in the _form
> collection is actually there.
>
> We're using fusebox so placing dump code in the switch is an option,
> just not very elegany to have to turn it on and off all the time.

Also, if you're using Firefox, the Firebug extension is quite handy for
viewing requests and seeing what exactly was POSTED to a given page.

- Clay
_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Re: Debug window of sorts?

by B. Perkins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>
>> Also, if you're using Firefox, the Firebug extension is quite handy for
>> viewing requests and seeing what exactly was POSTED to a given page.
I've never tried this with Active4D, but I'm wondering if it would be
possible to write an Active4D debug routine that would insert inline
Javascript that would wrap Firebug console.log statements? This might
allow you to dump debug statements to the browser console instead of
Active4D's console. Since we run the web server on Client, I have to
observe A4D's console via Timbuktu.

-- Brad

This is some PHP code which does something in the same vein. I just ran
a quick test and replacing the alert w/ console.log and it worked.

     function js_alert($msg)  {
    /*
    ------------------------------------------------------------
    Output markup that will cause a javascript alert to appear
    on screen.
   
    WARNING: This function may cause an error to occur if
    called from the wrong place within a page. One example would
    be from within PHP code that is already outputting JS
    markup.
    ------------------------------------------------------------
    */
       
        $html = "<script language=\"javascript\">
                 <!--
                     alert ('$msg');
                 //  -->
                 </script>";
       
        echo $html."\n";
       
    }

_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Re: Debug window of sorts?

by aparajita :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>>> Also, if you're using Firefox, the Firebug extension is quite  
>>> handy for
>>> viewing requests and seeing what exactly was POSTED to a given page.

There are two more extensions that are good in this regard, HttpFox  
and TamperData.


>>> I've never tried this with Active4D, but I'm wondering if it would  
>>> be possible to write an Active4D debug routine that would insert  
>>> inline Javascript that would wrap Firebug console.log statements?  
>>> This might allow you to dump debug statements to the browser  
>>> console instead of Active4D's console. Since we run the web server  
>>> on Client, I have to observe A4D's console via Timbuktu.

If you're using fusebox, put this at the bottom of your main layout,  
just before the </body> tag:


   <%
    if (<>A4D_BrowserConsoleOn)
                if (length(_request{"console.log"}) > 0)
                        write("<script type=\"text/javascript\">console.log('%s')</script>"  
% (replace string(_request{"console.log"}; "'"; "\\'")))
                end if
        end if
   %>


In the 4D method A4D_Init, add this code just before the call to A4D  
Init:

C_BOOLEAN(<>A4D_BrowserConsoleOn)
<>A4D_BrowserConsoleOn:=True

Then you can put code anywhere you want to write to the Firebug  
console. You could put something in the On Execute Start event handler  
to dump form variables:

if (<>A4D_BrowserConsoleOn)
    _request{"console.log"} := <code to dump form variables>
end if

Note that if you want to have multiple lines within a single console  
line, you need to put \\n in your Active4D string.

Regards,

    Aparajita
    www.aparajitaworld.com

    "If you dare to fail, you are bound to succeed."
    - Sri Chinmoy   |   www.srichinmoy.org


_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/
LightInTheBox - Buy quality products at wholesale price