Re: Package - Module
- To: mathgroup at smc.vnet.net
- Subject: [mg40480] Re: Package - Module
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Mon, 7 Apr 2003 04:55:51 -0400 (EDT)
- Organization: Universitaet Leipzig
- References: <b6j9gv$63k$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi, YouPackageContext`Private`line[i] or you add a usage message to the context of the package for line BeginPackage["YourPackageContext`"] line::usage="line[int] include some usefull information" Begin["`Private`"] line[im_] := Module[{i}, For[i=1, i <= 1024, i++, line[i] = im[[1,2,i]] ]; ]; End[] EndPackage[] Regards Jens Robert Pigeon wrote: > > Good day, > How can I "export" a variable from inside a Package-Module to a notebook ?? > Here's what I'm trying to do: > > In a Package I create a Module: > > Begin["`Private`"] > > line[im_] := Module[{i}, > For[i=1, i <= 1024, i++, > line[i] = im[[1,2,i]] > ]; > ]; > Where "im" is a FITS image Imported with Verbose-> True. > > Now, I want to have access to line[] in the notebook from where I called > line[]. It is not available, I get: > in>> line[1] > out >> line[1] > and not the list from the Module. > > But if I program the same Module in the notebook, then I have access to > line[]. > in >> line[1] > out >> the first line of the image imported as a list. > > I know that it is probably a basic question on Packages and Module... but I > read THE "book" and two other books on programming Mathematica and there is > things that I still do not understand :) > > Thanks, > > Robert