Posted By

Meestercor on 05/22/08


Tagged

textmate actionscript printr tracing


Versions (?)

Tracing array like print_r


 / Published in: Other
 

  1. function print_a( obj, indent ) {
  2. if (indent == null){
  3. indent = "";
  4. }
  5. var out = "";
  6. var start:Boolean = true;
  7. for ( item in obj ) {
  8. if (typeof( obj[item] ) == "object" ){
  9. if(!start){
  10. out += "n"+indent+ "[" + item + "] => Object";
  11. }
  12. else{
  13. out += indent+ "[" + item + "] => Object";
  14. }
  15. start = false;
  16. }
  17. else {
  18. out += indent+"[" + item + "] => " + obj[item]+"";
  19. }
  20. out += print_a( obj[item], indent+" " ) + " ";
  21. }
  22. return out;
  23. }

Report this snippet  

You need to login to post a comment.