Loading ...
Sorry, an error occurred while loading the content.

44[NH] misMatch

Expand Messages
  • Grant
    Jun 30, 1999
    • 0 Attachment
      In apology for the error of my misMatching post here's a simple mismatch
      error checker for *.js and *.css files. Checks for misMatching curly braces,
      comment blocks in js and css files and colon semicolon pair in css files and
      reports on any errors. I've called the clip misMatch so you can test it out
      however you could place it an onClose clip so it remains unobtrusive unless

      ^!Set %msg%=^%empty%
      ^!IfSAME "^$GetExt(^$GetDocName$)$" ".css" NEXT ELSE SKIP
      ^!IfDiff ^$StrCount(":";"^$GetText$";True;False)$
      ^$StrCount(";";"^$GetText$";True;False)$ msg1 Else Next
      ^!IfSAME "^$GetExt(^$GetDocName$)$" ".js" NEXT ELSE EXIT
      ^!IfDiff ^$StrCount("{";"^$GetText$";True;False)$
      ^$StrCount("}";"^$GetText$";True;False)$ msg2 Else Next
      ^!IfDiff ^$StrCount("/*";"^$GetText$";True;False)$
      ^$StrCount("*/";"^$GetText$";True;False)$ msg3 Else Next
      ^!Info ^%msg%
      ^!GOTO EXIT
      ^!Set %msg%=colon (:) count = ^$StrCount(":";"^$GetText$";True;False)$^%NL%
      ^!Set %msg%=^%msg%semicolon (;)
      ^!Set %msg%=^%msg%Declarations for each selector ought to contain a colon
      (:) and end with a semicolon (;)
      ^!Set %msg%=^%msg% exept for the last declaration which does not need to end
      with a semicolon (;).
      ^!Set %msg%=^%msg%However it is a good practice to grt in the habit of
      ending all css declarations with a semicolon (;)
      ^!Set %msg%=^%msg%^%NL%
      ^!Goto matchCurlies
      ^!Set %msg%=^%msg%left curly brace ({) count =
      ^!Set %msg%=^%msg%right curly brace ({) count =
      ^!Set %msg%=^%msg%Braces ({ }) must always occur in matching pairs
      ^!Set %msg%=^%msg%^%NL%
      ^!Goto matchComment
      ^!Set %msg%=^%msg%Comment start characters "/*" count =
      ^!Set %msg%=^%msg%Comment end characters "*/" count =
      ^!Set %msg%=^%msg%Comment block characters (/* */) must always occur in
      matching pairs
      ^!Set %msg%=^%msg%^%NL%
      ^!Goto CreateReport


      eGroups.com home: http://www.egroups.com/group/ntb-html
      http://www.egroups.com - Simplifying group communications
    • Show all 7 messages in this topic