[Thread Prev][Thread Next][Index]

Re: [ferret_users] equivalent to csh/tcl source command



Hi Mark,
          Hope the following information will be helpfull to achieve your
requirements :

  1. Ferret does have a "startup" file option (like .cshrc/.login). 

        .ferret : the Ferret initialization file, should be located in your
        $HOME(login) directory. This optional file holds a list of Ferret 
        commands that will be executed immediately each time Ferret is started.

        See Ch9 Sec2.  FILES AND ENVIRONMENT VARIABLES USED BY FERRET of user
        manual for details.

  2. All the variables and symbols loaded/defined in a Ferret session will be 
        available for all the commands which follow the load/define command,
        irrespective of whether the variable/symbol is accessed by the main
        script or any of the GO files. In other words, a variable get canceled
        from a Ferret section only if you cancel the respective variable 
        using "cancel variable" or dataset using "cancel data". The same rule
        goes for symbols too. 

  3. Due to rule 2 above, you don't have to pass "ANY" arguments to a go file.
        Suppose you define a variable called "P" in the main jnl file. If you
        intend to use the same variable name in the GO file, you don't have to
        "pass" P to the GO file, just use it there.

        The best example for rules 2 and 3 is the "regresst.jnl" GO file. 

In summary, for "global" ferret variables/symbols, 
     
      - you can either use a proper .ferret startup file in $HOME directory OR
      - do all the stuff in a SINGLE Ferret session, with the global variables
              defined towards the beginning of first script (and without any
              cancel commands in intermediate GO files).

If you have any questions, please let me know.

Regards,

Jaison



On Tue, 3 Jul 2007 Mark.Collier@xxxxxxxx wrote:

> Hi,
> 
> I'm wanting to execute swathes of ferret code repeatedly and want all
> local variables to be available, something similar to the source command
> in csh or tcl. Does such a command exist? The "go" command needs
> arguments supplied if local variables are to be used. I just simply want
> to collapse down long ferret journal scripts or use go where all
> variables are made global.
> 
>  
> 
> It's a simple concept but extremely useful and would like to see it on
> the future list of features if it doesn't already exist.
> 
>  
> 
> Regards,
> 
> Mark.
> 
> 
> 

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement