|
|||||||
| JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...) |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Hey there - this is my first post here, this seems like the place to post javascripts.
I'm not sure whether I've gone out on a limb to reinvent the wheel, but I've produced a data dumper, very similar to the one in Perl (here). The main function that the user should be interested in is a prototype of Object called dump. It can be fed an optional associative array of options (examples below). The method recursively looks through the object and returns the content of the object (excluding functions) I've attached the script (as a txt file), but I've uploaded it to my site as well, so you can use the example below - replace testArray with any object/string/array/number you like PHP Code:
The script also contains Object.duplicate, Object.isArray, Object.isNumber, Object.isString, which I think are all relatively self-explanatory. I'm interested in peoples feedback - I consider these Object functions finished, can anyone see any useful additions? Can anyone find any bugs, problems? Finally has this been done before/bettered? I did search google, but couldn't find one. Pete |
|
#2
|
||||
|
||||
|
Quote:
__________________
for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"')) {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n"; Last edited by Jeff Mott; 09-18-2003 at 05:41 PM. |
|
#3
|
||||
|
||||
|
Cool, so eventually there should be some proper data dumping, but I take it that'll be a while before that gets to be the norm.
My code is only really for developers - I can't believe no one else has written anything similar!?! I use the equivalent in perl on a daily basis at work and couldn't imagine developing without it (obviously there are differences between the language and its usage). Now (I at least) have a tool to see what's really going on with my objects/data - in my current project (3d modeller, still in alpha), I have a frame that is constantly pumped the data dumpers output, so I know what's going on. Any comments/suggestions? Pete |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|