Clip Needs to Write to two files
- 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
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:
*Have you ever had a virus on your personal computer?*
<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
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.
Personal Page: http://www.iserv.net/~dpasseng
Court Page: http://www.iserv.net/~dpasseng/grdc
- Hi Don,
>The **Had Virus** part is the same bit of info, and the ****Have hadYour ^!AppendToFile a good idea. Here some other ideas I tinkered with.
>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.
One way to do it may be to use
;^!SetDocIndex perhaps to use here
;^!SetDocIndex perhaps to use here
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
H="Spec A Doc"
;gets & sets to a variable the doc index of current document
^!Open "C:\My Documents\new.txt"
^!Toolbar Select All
^!IfSame "^$GetPasteBoardIndex$" "^%newidx%" skip
^!Toolbar Paste Board
;returns focus back to previously specified doc for cut/copy into the
;---<end of clip<<