SourceFormatX

Overview

Features

Why Use It

Formatting Show

Integration

Screenshots

Documentation

FAQs & Tips

Update History

Award Gallery

Testimonials

License Policy

CodeMorph

CodeToHtml

ASP Source Code Formatting Show


Feature

SourceFormatX code formatter bases on powerful syntax parse engines so it can beautify and format source code files with omnifarious styles, even these messy source code examples below:

C/C++ Java C# Delphi (Pascal)
PHP JSP ASP JavaScript
Visual Basic VB.NET VBScript HTML Components
80x86 ASM 8051 ASM CORBA IDL


This is an extreme ASP code formatting example, the purpose of it is to show the power of SourceFormatX ASP Code Formatting Tool's ASP syntax parse engine.

  <!-- Before ASP Code Formatting -->

  <%@ language=VBScript %>
  <html>
  <!-- Messy Source Code Example for ASP -->
  <head>
  <title>Draupnir Soft</title>
  <link rel="stylesheet" href="style.css">
  </head>
  <body bgcolor="#ffffff">
  <div align="center">
  <table border="1" cellpadding="0" cellspacing="0">
  <tr><td width="100%"><%=gbook_name%></td></tr>
  </table>
  </div>
  <%
  call htmlend()
  Response.End:end sub
  'Copyright (C) 2008 Draupnir Software
  sub addto()
  'Add guest name to database
  dim username, email, homeurl, qq, body, addtime, sql, Rs, ip, face, brow

  username=htmlencode2(trim(Request.form("username")))
  email=htmlencode2(trim(Request.form("email")))

  if username = "" then
  message="Your nickname cannot be null!\n"
  elseif username = "root" then
  message="Your nickname cannot be root!\n"
  end if

  sql="select * from retain where userid='"&userid&"'"
  set nrs = Server.CreateObject("ADODB.Recordset")
  nrs.open sql,conn,1,1
  do while not nrs.eof
  if username <>"" and username = nrs("retain_name") then
  message=message&"Your nickname was forbidden by administrator!\n"
  end if
  nrs.movenext
  loop
  nrs.close
  set nrs = nothing

  if email <> "" and IsValidEmail(email)=false then
  message=message&"Your email maybe wrong?\n"
  end if

  if body <> "" and Len(body)> bodymax then
  message=message&"Sorry, message length cannot over "&bodymax&" words!\n"
  end if

  if brow = "" then
  brow="image/em01.gif"
  end if
  if message<> "" then
  call error(""&message&"")
  else

  'Connect ADO now
  sql = "select * from gbook"
  Set Rs = Server.CreateObject("ADODB.Recordset")
  Rs.open sql,conn,3,2
  Rs.addnew
  Rs("username")=username
  Rs("email")=email
  Rs("homeurl")=homeurl
  Rs("qq")=qq
  Rs("body")=body
  Rs("face")=face
  Rs("brow")=brow
  Rs("ip")=ip
  Rs("addtime")=now
  Rs("userid")=userid
  Rs.update
  Rs.close

  sql="select * from admin where id="&userid
  Rs.open sql,conn,3,2
  if date <> today_time then
  Rs("today_count") = 1
  else
  Rs("today_count") = Rs("today_count")+1
  end if
  Rs("today_time") = date
  Rs.update
  Rs.close

  set Rs = nothing
  conn.close
  set conn = nothing

  Response.redirect "index.asp?userid="&userid
  Response.End
  end if
  end sub
  %>
  </body>
  </html>


  <!-- After ASP Code Formatting -->

  <%@ language=VBScript %>
  <html>
  <!-- Messy Source Code Example for ASP -->
  <head>
  <title>Draupnir Soft</title>
  <link rel="stylesheet" href="style.css">
  </head>
  <body bgcolor="#ffffff">
  <div align="center">
    <table border="1" cellpadding="0" cellspacing="0">
      <tr><td width="100%"><%=gbook_name%></td></tr>
    </table>
  </div>
  <%
  Call htmlend()
  Response.End
  End Sub

  'Copyright (C) 2008 Draupnir Software
  Sub addto()
      'Add guest name to database
      Dim username, email, homeurl, qq, body, addtime, sql, Rs, ip, face, brow

      username = htmlencode2(Trim(Request.form("username")))
      email = htmlencode2(Trim(Request.form("email")))

      If username = "" Then
          message = "Your nickname cannot be null!\n"
      ElseIf username = "root" Then
          message = "Your nickname cannot be root!\n"
      End If

      sql = "select * from retain where userid='"&userid&"'"
      Set nrs = Server.CreateObject("ADODB.Recordset")
      nrs.open sql, conn, 1, 1

      Do While Not nrs.EOF

          If username <>"" And username = nrs("retain_name") Then
              message = message&"Your nickname was forbidden by administrator!\n"
          End If

          nrs.movenext
      Loop

      nrs.Close
      Set nrs = Nothing

      If email <> "" And IsValidEmail(email) = False Then
          message = message&"Your email maybe wrong?\n"
      End If

      If body <> "" And Len(body)> bodymax Then
          message = message&"Sorry, message length cannot over "&bodymax&" words!\n"
      End If

      If brow = "" Then
          brow = "image/em01.gif"
      End If

      If message<> "" Then
          Call Error(""&message&"")
      Else

          'Connect ADO now
          sql = "select * from gbook"
          Set Rs = Server.CreateObject("ADODB.Recordset")
          Rs.open sql, conn, 3, 2
          Rs.addnew
          Rs("username") = username
          Rs("email") = email
          Rs("homeurl") = homeurl
          Rs("qq") = qq
          Rs("body") = body
          Rs("face") = face
          Rs("brow") = brow
          Rs("ip") = ip
          Rs("addtime") = Now
          Rs("userid") = userid
          Rs.update
          Rs.Close

          sql = "select * from admin where id="&userid
          Rs.open sql, conn, 3, 2

          If Date <> today_time Then
              Rs("today_count") = 1
          Else
              Rs("today_count") = Rs("today_count") + 1
          End If

          Rs("today_time") = Date
          Rs.update
          Rs.Close

          Set Rs = Nothing
          conn.Close
          Set conn = Nothing

          Response.redirect "index.asp?userid="&userid
          Response.End
      End If

  End Sub
  %>
  </body>
  </html>

  Don't waste time on formatting ASP code by hand any more!  Use SourceFormatX ASP Source Code Formatter today!