Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!ames!haven!umbc3!umbc5.umbc.edu!cs472226 From: cs472226@umbc5.umbc.edu (David Wood (CS472226)) Newsgroups: comp.lang.forth Subject: Re: File handling tips Summary: Other reasons for the BLOCK file Message-ID: <1868@umbc3.UMBC.EDU> Date: 5 Apr 89 12:23:38 GMT References: <8904040204.AA21175@jade.berkeley.edu> Sender: newspost@umbc3.UMBC.EDU Reply-To: cs472226@umbc5.umbc.edu.UUCP (David Wood (CS472226)) Organization: University of Maryland Baltimore Co. Lines: 55 ZMLEB@SCFVM.BITNET (Lee Brotzman) writes: >>David Phillip Oster (oster@dewey.soe.berkeley.edu.UUCP) writes: >>| >>| One advantage of traditional "blocks" over files: >>| >>| When your program crashes during LOAD, it is easier to fix it up and >>| continue, rather than FORGETing everything and restarting the load: (((stuff about MacForth structuring deleted))) > I don't know about MacForth, but, in my experience, block-oriented Forth >systems that run under host operating systems usually implement blocks as >1024-byte fixed-length records. There are no intervening end-of-line >characters or other record terminators. They are not at all like standard >text files, as evidenced by trying to print them and getting a run-on >mish-mash. > The reason I use blockish files while using Forth under MS-DOS, or Apple >ProDOS, or VAX VMS (our Forth system is implemented under all three plus a >few others) is for fast access to any part of the code. When an error occurs >I type WHERE and the editor puts my cursor at the point of the error. Or, if >I leave the editor, I type RESUME and I'm right back where I left off. It's >a simple matter to vector the system words to invoke these functions >automatically, I just haven't found it important enough to do. There are a few other reasons for using the BLOCK-oriented file under a host operating system: 1> Some FORTHs (at least GS16Forth that I know of) will allow you to restrict the size of your dictionary, declare a startup word, and save the system image to disk. The result: An independent application which you can run from whatever shell you please. If the system uses its OWN operating system, you can't save it and run it from your standard operating system. 2> With the more frequent introduction of mass storage devices, the typical block arrangement becomes impractical. A 1024-byte block was just ducky for a 5&1/4" diskette which would hold 100-200K, but with the 3&1/2"s (which hold 800K+) and hard disks (which hold some number of megs multiplied by ten), searching for screens unless you programmed in a directory screen in some prominent location becomes a real pain. 3> Not all FORTHOSes have communications systems, so they can't really send or receive files too well. By using a file storage protocol that Whatever-Term 4.19 can read, you can exchange code with other people. (By the way... How goes the call for comp.forth.binaries?) 4> It may be only as fast as the native operating system accesses it, but considering the advantages above, it's worth it to sacrifice a little speed to get the features. And now for something completely different... I'm looking for string-handling words, including variables, constants, LEFT$, RIGHT$, MID$, etc... Could anyone tell me where to get a collection like that? Are there any books with collections of routines in FORTH that I should know about but don't because I'm lazy? -David Wood Help! This account turns into a pumpkin in May! Where and how else can I stay in touch with UseNet?