Re: [Clip] FarClips in Large Libraries
- View SourceArt,
Far clip does have some limitations compared to a clip in the same library.
1. If you use a common far clip that needs to call a clip in the
starting library. You need to use far clip to call the clip in the
I use far clips for common functions. These I put in a clip called
"call" The most used clip is a loop clip. Called "loopA" that needs an
array called ^%arrayA%. I pass the farclip a parameter that is the
subroutine clip. The subroutine is in the calling clips library. So my
call is complex but saves a lot of other coding. Using ^$GetLibraryName$
makes the clip more transportable to other clips.
^!farclip "call:loopA" ^$GetLibraryName$:actionforeacharrayitem
2. Custom functions as opposed to a clip can't be called from far clips
as such. However that limitation can be worked around by using a local
custom function as a wrapper for a far clip.
I have a custom function ^$xdigits()$ that adds zeros in front of a
number so it is the required length. That is if the function is used
^$xdigits(5;10)$ then 00010 will be returned. You can add a local clip
called ^$farfunc()$ that takes as many parameters as you choose to build
it for. It acts like a function but it calls farclips that have a single
variable that is then inserted as the result of the farfunc. I don't use
this as much as ^!farclip but it has its uses.
In the local library
Fill this number to four digits ^$farclip(call:xdigits;4;1)$
; FarFunc can call some functions in another clipbook
; xdigits, 2digit,
^!farclip "^%part1%" ^%param%
In the far library named "call"
; Output a set number of digits, that is padded with zeros.
; ^$xdigits(2;5)$ would return 05
; ^$xdigits(4;50)$ would return 0050
; can be called as a far function by farfunc clip.
; example ^$farfunc(call:xdigits;4;5)$ will return 0005
^!if ^$IsNumber(^%numb2%)$=1 switch else outofrange
^!if ^$StrSize("^%numb2%")$>^%digits% outofrange
^!info Out of range. No number with between 1 and ^%digits% digit input.
The script will exit.
That is the issues I see. Surmountable but require some modification work.
On 3/08/2012 8:46 AM, Art Kocsis wrote:
> I am forced to bite the bullet to reorganize and partition
> my clip library as it is way past too large and unwieldy.
> Although most of the interclip calls will stay within a given section,
> some do not. To prevent future breakage, I am considering changing
> all of the clip calls to FarClips.
> Is there any penalty or gotchas for doing this when a called clip is in
> the same library and the Far attribute is unnecessary?
> Any other tips or suggestions on organizing large libraries?
> Thanks for your suggestions,
[Non-text portions of this message have been removed]