a script with a variable name to load

From: mark collier <Mark.Collier_at_nyahnyahspammersnyahnyah>
Date: Fri Apr 01 2011 - 00:18:34 MDT

Hi,
often I run code from an external NCL script.

For example, the external script a.ncl might contain

a=1.0

and so in my parent script I can simply go

begin
load "a.ncl"
print(a)
end

and so the variable a is effectively global in extent, and it often
helps to keep the parent script compact and the code more clumped by
relevance.

However, I can't load a script in a variable location, eg

idir="/home"
load idir+"/a.ncl"
print(a)

or variations, I get a message like "input in flex scanner failed". It
works if I put the full path in, however, the aim is to have a
variable path. I think I understand why it is failing, but are looking
for a work around?

Regards,
Mark.
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Apr 1 00:18:44 2011

This archive was generated by hypermail 2.1.8 : Tue Apr 05 2011 - 09:01:21 MDT