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

Re: [Clip] Subroutines, again

Expand Messages
  • Don Daugherty
    ... As a another way to reduce visual clutter, you can simply locate the subroutine Clip immediately below the main Clip, but grey it out by placing an
    Message 1 of 5 , Nov 22, 2010
    • 0 Attachment
      On 11/22/2010 12:20 PM, Eb wrote:
      > Adding to what's already posted, you can incorporate variables into subroutine calls:
      >
      > ^!Goto ^%subroutine%
      >
      > Or:
      >
      > ^!Goto ^?{Pick a sub to jump to==sr1|sr2|...|srn}
      >
      > However, I prefer to reduce my visual clutter in both the clipboook AND the clips, by abstracting subroutines to another library.
      >
      > You call a sub in another library with the FarClip command:
      >
      > ^!FarClip "farlibraryname:clipname" OptionalArguments
      >
      > The only drawback with far libraries is, that you can't use them for custom functions. If you just gotta have a clip on the right side of an assignment, you'll have to have a custom function in the same library.
      >
      > You COULD create a single custom function, to which you pass one of several names of a far clips, call that clip, pass any result back as a global variable, then return it as a function result.
      >
      > Done right, your main clip might contain:
      >
      > ^!Set %myResult%=^$myFarFunction(^%farlib%;^%farclip%;^%arguments%)$
      > ;or
      > ^!Set %myResult%=^$myFarFunction("libname";"clipname";^%arguments%)$
      >
      > and the tranlator function might be:
      >
      > H="_myFarFunction"
      > ;shared function, requires syntax:
      > ;^$myFarFunction(farlib;farclip;arguments)$
      > ^!SetArray %args%=&
      > ^!FarClip "^%args1%:^%args2%" ^%args3%
      > ^!Result %globalresult%
      > ;this global result is of course set by your far clip
      >
      >
      >
      >
      >
      > Cheers,
      >
      >
      > Eb
      >
      > PS:
      >
      > --- In ntb-clips@yahoogroups.com, "John Shotsky"<jshotsky@...> wrote:
      >> ...
      >> It would be great to have '^!Call' and '^!Return' commands
      > You already have these commands. They just have different names and may have more functionality.
      >
      > ^!Clip cliname
      >
      > ^!Goto LABEL
      >
      > ^!Goto END
      > or simply ending the clip
      >
      > ^!Result value
      >
      > ^!Set %result%
      > ;and end the clip
      >
      >
      >
      >
      >
      > ------------------------------------
      >
      > Fookes Software: http://www.fookes.com/
      > NoteTab website: http://www.notetab.com/
      > NoteTab Discussion Lists: http://www.notetab.com/groups.php
      >
      > ***
      > Yahoo! Groups Links
      >
      >
      >
      >
      As a another way to reduce visual clutter, you can simply locate the
      subroutine Clip immediately below the main Clip, but "grey" it out by
      placing an underscore in the header of the subroutine Clip in the code
      edit window. Assuming you have Headers Showing and that the subroutine
      Clip is named "Subroutine", simply change line 1 from "Subroutine" to
      "_Subroutine" (no actual quotes of course.)

      If headers are not showing, line 1 will be the first line of code; In
      that case right-click over any clip in the Clip Library window and click
      Show Headers to get it checked.
    Your message has been successfully submitted and would be delivered to recipients shortly.