Re: [Clip] Manage Forwarding Lists
- Ray Shapp wrote:
> I think it might be best if the six file names were storedPossibly, but I'd choose a different approach. As you have to write down
> in an array, and an integrated clip were to loop six times.
those six paths anyway, I'd make do without a formal loop and write the
main code linearly for all six. Arrays and indices only invite hard to
find mistakes. Clips does not have subroutines as programming languages
do, it lacks the RETURN command, but unless I'm mistaken you can use
what FORTRAN calls "assigned gotos", i.e:
So your main part would mainly consist of ^!Set directives and after
setting the proper return points you call "subroutines" with ^!Goto.
> Also, how does one force "save as" if the file nameSave or close the offending second document first. You can swap the
> is already in use?
active focus with ^!Document [FIRST|LAST|NEXT|PREV]
- Hi Ray,
I took a closer look at your code. There are several syntax problems.
1. You _must_ use the "end" label in a subroutine clip (cvs)
rather than "exit", if you want to return to the caller.
Using the EXIT label ends execution right then
and does NOT return to the caller.
In other words:
2. Syntax error and redundant:
a) ^!Setfocus ^%WorkingFile%.csv
b) ^!SetFocus DOCUMENT
would change focus to the document window,
if it weren't already there from the ^!Open command
The command, if correct, would be redundant.
3. Confusing code in the destroy subroutine
a. ^!Close "^&"
closes the document in NoteTab, leaves disk file intact
if you also want to delete the disk file, you could
or use the next command by itself
b. ^!DestroyDoc "^&"
closes open doc and sends the file to the recycle bin
c. If the file is NOT open in NoteTab, use
4. Finally, your main cvs code does not make sense
a. why bother to do any replacements in the old file,
when you delete it in the next line?
b. why save the new file before opening it?
I suggest you start from scratch, by outlining the steps you would like to take, and then converting the individual steps to code.