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

[NH] misMatch

Expand Messages
  • Grant
    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
    Message 1 of 7 , 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
      required.


      H="misMatch"
      ;simpleMatchChecker
      ^!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
      :matchCurlies
      ^!IfDiff ^$StrCount("{";"^$GetText$";True;False)$
      ^$StrCount("}";"^$GetText$";True;False)$ msg2 Else Next
      :matchComment
      ^!IfDiff ^$StrCount("/*";"^$GetText$";True;False)$
      ^$StrCount("*/";"^$GetText$";True;False)$ msg3 Else Next
      :CreateReport
      ^!Info ^%msg%
      ^!GOTO EXIT
      :msg1
      ^!Set %msg%=colon (:) count = ^$StrCount(":";"^$GetText$";True;False)$^%NL%
      ^!Set %msg%=^%msg%semicolon (;)
      count^$StrCount(";";"^$GetText$";True;False)$^%NL%
      ^!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
      :msg2
      ^!Set %msg%=^%msg%left curly brace ({) count =
      ^$StrCount("{";"^$GetText$";True;False)$^%NL%
      ^!Set %msg%=^%msg%right curly brace ({) count =
      ^$StrCount("}";"^$GetText$";True;False)$^%NL%
      ^!Set %msg%=^%msg%Braces ({ }) must always occur in matching pairs
      ^!Set %msg%=^%msg%^%NL%
      ^!Goto matchComment
      :msg3
      ^!Set %msg%=^%msg%Comment start characters "/*" count =
      ^$StrCount("/*";"^$GetText$";True;False)$^%NL%
      ^!Set %msg%=^%msg%Comment end characters "*/" count =
      ^$StrCount("*/";"^$GetText$";True;False)$^%NL%
      ^!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
    • Bob Janes
      ... If you really want to maintain control of the layout of a series of pages then go for Adobe Acrobat. The reader (and printer) is free and readily
      Message 2 of 7 , Jul 1, 1999
      • 0 Attachment
        > Or are we talking Adobe
        > Acrobat (words which spring to the lips but fill no spaces
        > between my ears)?
        >
        > So printable versions. Anyone an expert? Know anything at all?!

        If you really want to maintain control of the layout of a series of pages then
        go for Adobe Acrobat. The reader (and printer) is free and readily available.
        Acrobat documents can contain links and graphics and (importantly) Acrobat
        manages the transition from A4 to US 8.5 x 11 as smoothly as anything I've used
        before. Printed copies seem to work on a range of printers and to give a good
        representation in each case that I've tested.

        To use Acrobat you need Acrobat Distiller (effectively a printer driver) which
        comes with the commercial Acrobat package (currently v4) lists at UKP 149 + VAT
        and doubtless available much cheaper elsewhere.

        V4 also supports web download so that you can capture a part or all of a web
        site into an Acrobat document and then edit it for printing or re-transmission.
        I'm still on v3 so haven't tested this but it's potentially a great way of
        creating multi-media distributable documents from NoteTab -- anyone tested it
        yet?

        Alternatives are specialist Web Printers -- HP have one that I had on my system
        for a while but it watched everything and was intrusive so it got scrapped with
        very little use. Web printers also require client intervention whereas Acrobat
        puts most of the control and most of the work with the 'publisher' which is
        where it needs to be when you start broadcasting material.

        Best regards

        Bob

        PS E-mail me privately if you want to know more as this is only just a NoteTab
        topic.

        --

        Bob Janes
        Webster & Janes Ltd
        PO Box 211, Welwyn AL6 0EX UK
        +44 (1438) 84-0206
        mailto:bob.janes@...
        http://www.webster-and-janes.co.uk/co.re/



        ------------------------------------------------------------------------

        eGroups.com home: http://www.egroups.com/group/ntb-html
        http://www.egroups.com - Simplifying group communications
      Your message has been successfully submitted and would be delivered to recipients shortly.