Steve Hall wrote:
>In this message
> Is there any way to include a script within another script so that the
> s: scope of the first is available to the second? I want to create
> a library of variables external to the functions that use them, but
> still not make them global.
I've copied a piece of vim code to get the <SID> of a script.
Here how it could be used:
With the SID you can get any information in the sourced script
May be just about function in fact...
But you could do (not tested)
" in the sourced script
exe "let v=s:".a:varname
and then when you want a variable:
" call the script function with the specified argument
exe "let v=\<SNR>".sid."_Getvar(".varname.")"
It may be more tricky, but if that's what you want, you have a hint. ;)
- Sylvain Viart -
- Blainville - Canada -
Je parle aussi le français.
- On Sun, 2002-12-01 at 21:21, Sylvain Viart wrote:
> Steve Hall wrote:
> > Is there any way to include a script within another script so that
> > the s: scope of the first is available to the second?
> [clever local s:var announcing function example]
> It may be more tricky, but if that's what you want, you have a hint.
Heh, tricky indeed--in two months I'll never remember how it works!
Suppose I could just make them <shudder> globals. (But thanks for the
example, I've stashed it in the library for later reference.)
Steve Hall [ digitect@... ]