Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

general file search paths in SP-Forth?

8 views
Skip to first unread message

Marcos Cruz

unread,
Dec 11, 2006, 10:39:17 AM12/11/06
to
I'm testing SP-Forth [http://sourceforge.net/projects/spf/] to run an
ANS Forth application of mine and I need to set the default paths for
all file operations.

I have searched into its documentation but I did not find anything
about file paths but a file (devel/~pinka/samples/2005/lib/lay-path.f)
that "provides words for lay a path to file (creating non-existent
folders)". That's not really what I need. I could use that solution,
but I would have to add a new layer in my code and then adapt it back
to run in other ANS Forths.

I need something transparent and simpler, like the "General Search
Paths" words of gforth.

If needed, I could adapt the SP-Forth code myself but perhaps someone
has had the same problem before.

Thank you

Marcos

ygrekh...@gmail.com

unread,
Dec 12, 2006, 5:35:06 AM12/12/06
to
In SPF INCLUDED works in the following way - S" file.f" INCLUDED will
search - first the short name file.f (i.e. in the current directory),
then PATH_TO_SPF.EXE\devel\file.f (thus allowing to use other spf
developers' code), then PATH_TO_SPF.EXE\file.f (thus including standard
libraries and other files from SPF distribution). If you need to
specify more paths (for example to use some forth code shared between
several forth systems, or whatever - any code that is not in the spf
files subtree and cannot be addressed relatively from your current
file), then you can either redefine FIND-FULLNAME(which is VECT) or use
my solution - ~ygrek/lib/included.f All you need is to write in
spf4.ini

~ygrek/lib/included.f
with: my_path\
S" my path with spaces/" with

or

MODULE: included_path
CREATE my_path/
S" My path with spaces/" CREATED
;MODULE

and all the files will be searched in my_path in addition to the
earlier described algorithm (my_path can be either absolute or relative
spf.exe).
Hope that helps.

---
~ygrek

Marcos Cruz

unread,
Dec 18, 2006, 7:30:25 AM12/18/06
to
ygrekhereti escribió/skribis/wrote:

> In SPF INCLUDED works in the following way - S" file.f" INCLUDED will ...

Thank you very much for the detailed solution. I will try it. I have
worked with gforth, Win32Forth and others, but SP-Forth is a recent
discovery for me.

0 new messages