Group Abstract Group Abstract

Message Boards Message Boards

User-written package not processed when Get or Needs requests access

POSTED BY: Lawrence Winkler
5 Replies
Posted 6 years ago

If you have a notebook and want to convert it to a package:

1. Wrap the notebook code between BeginPackage["context`"] and EndPackage[]. Make all the input cells to be initialization cells.

enter image description here

2. Save the .nb file as a .wl file in a place where MMA will find it. Filename same as the context. PackageTest in this example.

3. It should now be possible to call and use the package

enter image description here

POSTED BY: Hans Milton

Welcome to Wolfram Community! Please make sure you know the rules: https://wolfr.am/READ-1ST

The rules explain how to format your code properly. If you do not format code, it may become corrupted and useless to other members. Please EDIT your post and make sure code blocks start on a new paragraph and look framed and colored like this.

int = Integrate[1/(x^3 - 1), x];
Map[Framed, int, Infinity]

enter image description here

POSTED BY: EDITORIAL BOARD

The context mark is in my code and in the message. However, the post eliminated the hash marks in the second paragraph. Thanks for pointing that out. I'll try to fix the post.

POSTED BY: Lawrence Winkler
Posted 6 years ago

Try Needs["Fred`"]

Notice the context mark after Fred.

POSTED BY: David Keith
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard