A MSWLogo startup file
A startup file is a file that will be loaded automatically when starting MSWLogo.
The procedures defined in this startup file provides an easy way for you to
define pseudo-primitives, that is buried procedures you will not see in the
MSWLogo editor but you can use in your programs. Just put some LGO files in
a sub-directory of the MSWLogo installation directory - the sub-directory name
has to be named `buried'. All these LGO files will be loaded at MSWLogo startup
and the procedures and variables defined in these files will be buried. For
example my colors.lgo file should be put there (this color management utility
can add a hundred of definitions and even more if you like colors and foreign
languages). The startup.lgo also provides an `user.dir' variable and will change
the current directory to the value of this variable (if the directory exists).
Who should be interrested?
- you are a teacher and you want to make some procedures available to each
student transparently (pseudo-primitives - the student will not see theses
procedures in the MSWLogo editor)
- you are using the MSWLogo editor and start to have too many definitions
in the workspace. You could put some of your procedures in LGO files into
the MSWLogo `buried' sub-directory
- you have to work in different contexts, on different projects. Using different
Logo working directories, one for each context, you could use the same mechanism
and put files in a `buried' sub-directory under each working directory (in
the startup.lgo file look for the `user.dir' variable definition and the second
call to `load.lgo.files' procedure). Having one different directory for each
context, you will have to edit the startup file and change the value of the
user directory each time you want to start MSWLogo in another context. If
you have to switch frequently from one context to another, a better solution
would be to set a dialog that pops up at startup time and asks which context
you want (and sets the user directory variable).
How to install?
- in the `Target' field of your MSWLogo shortcut add the following : -l startup.lgo
the content of this field should thus be : c:\program files\MSWlogo\logo.exe
-l startup.lgo (if MSWLogo has been installed in c:\program files\) By the
way, the content of the `Start in' field has to be what it was when MSWLogo
has been installed, that is : c:\program files\MSWlogo\
- Put the startup.lgo file in the MSWLogo directory
- make a sub-directory named `buried' under the MSWLogo directory
- put the colors.lgo file in the `buried' sub-directory and any LGO file you
want
- Possibly, in the startup.lgo file, initialize the `user.dir' variable (look
for `make "user.dir' in the startup.lgo file)
- to check the installation, start MSWLogo : you should see a colored tree
on the screen and a `... startup file loaded' message in the text window.
To see the colored tree, the colors.lgo file has to be in the `buried' sub-directory,
else comment in the 2 calls to `colored.tree' in the startup.lgo file.
www.algo.be/logo.html