Re: Fwd: File-only global variable in Script-Fu?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chad Jones wrote:
> If I want to create a file global variable or constant which is global 
> to that file but not viewable outside that file what is the recommended 
> way of doing this?

All scripts are read in to a single namespace (ie. block of memory). Any 
variable that is global to one file will be accessible to all scripts. There 
is no way at the present time to define a variable in a file that can only be 
access from that one file. This will change in some future version of Script-Fu.

> I have come across Pedro Gimeno's "Local Functions in Script-Fu" 
> solution which includes wrapping the entire script-fu file in a let* 
> statement.

The better way to define variables or functions so they are local to a 
function is by putting them after the define line but before the let block.

-- 
Cheers!

Kevin.

http://www.ve3syb.ca/           |"What are we going to do today, Borg?"
Owner of Elecraft K2 #2172      |"Same thing we always do, Pinkutus:
                                 |  Try to assimilate the world!"
#include <disclaimer/favourite> |              -Pinkutus & the Borg

[Index of Archives]     [Gimp Developers]     [Gimp Users]     [Yosemite News]     [Epson Inkjet Printers]     [Scanners]     [Gimp's Home]     [Steve's Art]

&hbsp; Powered by Linux