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

Re: [Clip] 3-Column Table

Expand Messages
  • Ray Shapp
    Hi Eb, ... You are the first. Thank you. That looks dangerous because a
    Message 1 of 39 , Apr 1, 2011
    • 0 Attachment
      Hi Eb,

      <<Not sure if anyone answered these questions:>>
      >

      You are the first. Thank you.


      << ^!IfFileExist "filespec" SKIP >>


      That looks dangerous because a person might add a few blank lines to a clip
      to make it more legible, and that could cause an error. I think I will stay
      with explicit labels.


      <<Both END and EXIT are predefined labels.>>


      Yes, I had seen that in Help, but I didn't realize the ^!GoTo was necessary
      after an ^!Info box for example. I saw END working in ^!If statements, but I
      like to display some kind of message at every terminating point in the clip.

      The revised clip is working well. While it is true that the HTML page needed
      reformatting only six to ten times a year as a result of work in the vehicle
      restoration shop, now that I have a working clip, I am reformatting the page
      much more frequently because it is so easy to make little tweaks. I thank
      everyone who contributed to this clip. My only remaining question is whether
      my file handling operations could have been done more efficiently. The goal
      is to produce a formatted TEMP file that I can inspect before posting while
      avoiding collisions with any previous TEMP file or any .bak file that was
      made from a previous TEMP file. Also if a collision does occur, I don't want
      to delete the older file(s) without inspecting it (them). The revised clip
      is shown below.

      Ray Shapp

      ***clip follows after one blank line***

      Three Cells Per Row
      ^!SetDebug On

      ^!IfFileExist "H:\Websites\Websites from c3ghz\Classicars
      Albums\projects\OneRowIndex.htm" DoesTempExist NoOneRow

      :DoesTempExist
      ^!IfFileExist "H:\Websites\Websites from c3ghz\Classicars
      Albums\projects\OneRowIndexTEMP.htm" TempExists

      :SaveTemp
      ^!Open "H:\Websites\Websites from c3ghz\Classicars
      Albums\projects\OneRowIndex.htm"
      ^!Save AS H:\Websites\Websites from c3ghz\Classicars
      Albums\projects\OneRowIndexTEMP.htm

      ;Reformat TEMP file
      ^!Find "Click on a picture" WRS
      ;Begin long line
      ^!Replace "(?s)(\<td.+?\</td>\s*+){2}\<td.+?\</td>" >> "\<tr
      valign="middle">\r\n$0\r\n</tr>\r\n<tr><td colspan="3"> </td></tr>" ARS
      ;End long line
      ^!GoTo NormalEnding

      :TempExists
      ;Begin long line
      ^!IfFileExist "H:\Websites\Websites from c3ghz\Classicars
      Albums\projects\OneRowIndexTEMP.bak" bakExists
      ;End long line
      ;Begin long line
      ^!Open "H:\Websites\Websites from c3ghz\Classicars
      Albums\projects\OneRowIndexTEMP.htm"
      ;End long line
      ;Begin long line
      ^!RenameDoc "H:\Websites\Websites from c3ghz\Classicars
      Albums\projects\OneRowIndexTEMP.bak"
      ;End long line
      ^!GoTo SaveTemp

      :bakExists
      ^!INFO Both "TEMP" and ".bak" files exist.^pAborting
      ^!GoTo exit

      :NoOneRow
      ^!INFO Can't find H:\Websites\Websites from c3ghz\Classicars
      Albums\projects\OneRowIndex.htm^pAborting
      ^!GoTo exit

      :NormalEnding
      ^!INFO OneRowIndexTEMP.htm is ready for inspection.
      ^!GoTo exit

      ***clip ended two lines above***



      On Fri, Apr 1, 2011 at 3:42 PM, Eb <ebbtidalflats@...> wrote:

      >
      >
      > Not sure if anyone answered these questions:
      >
      > > is there a complement to ^!IfFile*NOT*exist
      >
      > No, but:
      >
      > ^!IfFileExist "filespec" SKIP
      >
      >
      > > I tried ^!End and ^!Exit, but neither worked
      >
      > Both END and EXIT are predefined labels.
      >
      > ^!Goto END
      > goes to end of clip, returns to calling clip, if any
      >
      > ^!Goto EXIT
      > stops execution, does NOT return to calling clip, if any
      >
      > _
      >


      [Non-text portions of this message have been removed]
    • Eb
      Let me add to this, that NoteTab s clips started out as blocks of text, assigned to a keyword (the clip name). Even though clips can do much more than those
      Message 39 of 39 , Apr 5, 2011
      • 0 Attachment
        Let me add to this, that NoteTab's clips started out as blocks of text, assigned to a keyword (the clip name). Even though clips can do much more than those original ones, that early feature is still available, and a mix of text and clip code as well.

        In other words, this is not a designe error, but an evolution, where powerful features ware added, along with backward compatibility.

        The need to watch for blank lines in your code is at worst a trade-off for more features.

        By the way, Ray figured out one of the workarounds - jumping to a label, rather than SKIPping. Another workaround is to place semicolons at the start of every blank line, if its only purpose is to make the code more readable.


        Cheers,


        Eb

        --- In ntb-clips@yahoogroups.com, hsavage <hsavage@...> wrote:
        >
        > Axel Berger wrote:
        > > Ray Shapp wrote:
        > >> That looks dangerous because a person might add a few blank
        > >> lines to a clip to make it more legible,
        > >
        > > Begob, you're right! I was convinced that NoteTab would do the right
        > > thing and ignore emty lines, but it doesn't:
        > >
        > > ^!IfSame 1 1 Skip
        > >
        > > ^!Continue Not skipped
        > > ^!Continue skipped
        > >
        > > To me this is a design error and an important point to keep in mind.
        > >
        > > Thanks
        > > Axel
        >
        > Axel, Ray,
        >
        > It is stated in NoteTab help that only 'commented lines, those
        > beginning with semi-colon are not counted during clip execution.
        >
        > SKIP
        > will skip the next instruction (text and blank lines are counted, but
        > not commented lines).
        >
        >
        > ···············································
        > ¤• JD#...91 - ¤• SL...727 - 11.04.01~19.38.19
        >
        > • If you write "WASH ME" on my truck,
        > • I'll carve "RESUSCITATE ME" on your chest!!!
        >
        > € hrs € hsavage € pobox € com
        >
        > ^!Skip
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.