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

Clip Needs to Write to two files

Expand Messages
  • Don Passenger
    I am attempting a clip which needs to generate two files. I started by taking the html.tpl file and modifying it (saved under a different name of course). It
    Message 1 of 2 , Dec 14, 2000
    • 0 Attachment
      I am attempting a clip which needs to generate two files.
      I started by taking the html.tpl file and modifying it (saved under a
      different name of course). It generates file number 1, which is an html
      file. I start this renamed .tpl file by using a modified version of the
      "New Web Page" clip in the HTML Library but pointing it to the renamed .tpl
      file.

      I get to a point in the .tpl file where I need to generate a table...and I
      am getting close to having this part work...
      It needs to run through a loop where it asks me information and I need to
      take that information and put it into a table cell...

      The output looks like this:
      <TR>
      <TD>
      *Have you ever had a virus on your personal computer?*
      </TD>
      <TD>
      <INPUT TYPE="RADIO" NAME="ITEM_1" VALUE="ITEM_1|**Had Virus**" >***Yes***
      <INPUT TYPE="RADIO" NAME="ITEM_1" VALUE="ITEM_1|No Virus" >No
      <INPUT TYPE="RADIO" NAME="ITEM_1" VALUE="ITEM_1|No Answer" checked>No
      Answer
      </TD>
      </TR>

      I prompt for the *question*, **Had Virus**, ***Yes*** (the asterisks would
      not appear in the actual content, but were placed as markers). This then
      needs to loop for the next ITEM_1, until there are no more ITEM_1 questions.
      Once I ask the question, I ask how many Input Items there are for that
      question, in this case there are three.
      I think I can get that part with some trial and error.

      Here is my problem, I also need to take that same information and write it
      to ANOTHER data file like this:

      ITEM_1|**Had Virus**:0:****Have had a virus****:
      ITEM_1|No Virus:0:Have never had a virus:
      ITEM_1|No Answer:0:No answer:

      The **Had Virus** part is the same bit of info, and the ****Have had a
      virus**** part is another prompted question.
      So after that lead in...how do I take the info in the variables and output
      to a second file. Then I need to cycle back for question two writing to the
      html file and then to the data file.

      Thanks for any help and suggestions.


      ---
      Don Passenger
      Personal Page: http://www.iserv.net/~dpasseng
      Court Page: http://www.iserv.net/~dpasseng/grdc
    • Alan
      Hi Don, ... Your ^!AppendToFile a good idea. Here some other ideas I tinkered with. One way to do it may be to use ^!Set %memidx%=^$GetDocIndex$
      Message 2 of 2 , Dec 14, 2000
      • 0 Attachment
        Hi Don,

        >The **Had Virus** part is the same bit of info, and the ****Have had
        >a virus**** part is another prompted question. So after that lead
        >in...how do I take the info in the variables and output to a second
        >file. Then I need to cycle back for question two writing to the
        >html file and then to the data file.

        Your ^!AppendToFile a good idea. Here some other ideas I tinkered with.

        One way to do it may be to use

        ^!Set %memidx%=^$GetDocIndex$
        ^!SetClipboard ^%variable%
        ;^!SetDocIndex perhaps to use here
        ^!Toolbar Paste

        or

        ^!Set %memidx%=^$GetDocIndex$
        ;^!SetDocIndex perhaps to use here
        ^!InsertText ^%variable%

        Note the docindex functions, both get and set in the following clip. The
        following clip records index of currently focused document. Then it
        insures that the new.txt file is open. Then it detects whether or not
        new.txt is a pasteboard or not. If it is not a pasteboard, the clip makes
        it a pasteboard. If it is a pasteboard then the clip skips that step. It
        emptys contents of new.txt which readys for cut/copy. Then the clip
        switches back to what had formerly been your currently focused
        document. Then you can select text from that document and cut or copy
        which puts it into the new.txt pasteboard. When done with cut/copy can do
        a file save as and assign a different filename. Just some ideas,
        HTH. Regards. Alan. Maybe there's a save as file clip command could be
        used too.

        H="Spec A Doc"
        ;gets & sets to a variable the doc index of current document
        ^!Set %memidx%=^$GetDocIndex$
        ^!Open "C:\My Documents\new.txt"
        ^!Set %newidx%=^$GetDocIndex$
        ^!Toolbar Select All
        ^!Keyboard DELETE
        ^!IfSame "^$GetPasteBoardIndex$" "^%newidx%" skip
        ^!Toolbar Paste Board
        :ready
        ;returns focus back to previously specified doc for cut/copy into the
        pasteboard doc
        ^!SetDocIndex ^%memidx%
        ;---<end of clip<<
      Your message has been successfully submitted and would be delivered to recipients shortly.