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

14980Re: [Clip] Understanding Writing Subroutines

Expand Messages
  • Don - htmlfixit.com
    Apr 15, 2006
      Bob McAllister wrote:
      > I guess that you could argue it to be "bad form" in some abstract
      > computer science sense, but it does happen to be how Eric wrote
      > NoteTab. Have a look at the Custom Functions page in Clip Help where
      > it is described as "an approach similar to the ^!Clip command".
      >
      I didn't realize that this was a custom function. I guess you are
      correct and that won't go away. I also see what you say about passing a
      parameter.

      It appears that the only way to pass a parameter is the highlight the
      "parameter" so the parameter must be in your text document? I remember
      trying to understand these a while back and thinking that it wasn't
      worth the effort. Here is how I have taken to using "subroutines" and
      as you see I am using an array to pass the parameters.

      H="first letter"
      ;set variables to be passed as parameters
      ^!SetArray %items%=red;orange;yellow;green;blue;indigo;violet
      ;call "subroutine"
      ^!Clip "grabfirstletters"
      ^!SetArray %items%=Mediocrity;Ego;Limits;Vanity;Incompetence;Name-calling
      ;call "subroutine"
      ^!Clip "grabfirstletters"


      H="_grabfirstletters"
      ^!Set %count%=1;%string%=""
      :Loop
      ^!Set %string%=^%string%^$StrCopyLeft("^%items^%count%%";1)$
      ^!Inc %count%
      ^!If ^%count% <= ^%items0% Loop
      ^!InsertText ^%string% = ^%items%^P
    • Show all 11 messages in this topic