home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!pitt!willett!ForthNet
- From: ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie)
- Newsgroups: comp.lang.forth
- Subject: Help for F-PC and TCOM
- Message-ID: <4267.UUL1.3#5129@willett.pgh.pa.us>
- Date: 21 Jan 93 11:33:39 GMT
- Organization: EIEI-U
- Lines: 109
-
- Category 7, Topic 35
- Message 31 Wed Jan 20, 1993
- ELLIOTT.C at 18:09 EST
-
- -----via CRS Premium Bulletin Board -
- USR Dual Standard 16.8K (416) 629-7000
-
- Date: 01-10-93 (12:15)
- To: ALL
- From: M SIMON
- Subj: PROGRAMMING PROBLEM FPC
-
- I tried the following program which I cribbed from the files
- included with FPC (PDP-8 stuff). It does not open a file which is
- known to reside in the same directory as FPC. No error message is
- returned. HOPEN indicates success opening the file. I am stumped.
-
-
- M. Simon / Space-Time Productions
- 3124 Meriday Suite 103
- Rockford, Illinois 61109
- [ 815 ] 874-2296
-
- /// this space for lend, lease, sale, rent, or time \\\
-
-
- handle ofile \ output file handle
-
- : ofile-msg cr ." Enter filename: " cr ;
- : open-err-msg cr ." Can't find source file. " cr ;
- : retry-msg cr ." Hit any key to retry. " cr ;
-
-
- \ string input function
- 40 constant max_length
- create str-buf max_length allot
- : clr-str-buf str-buf max_length erase ;
-
-
- : length-s ( adr --- count )
- max_length 0
- do dup i + c@ 0=
- if i leave
- then
- loop swap drop ;
-
-
- \ get user input string and store as counted string at addr
- : accept ( addr n --- )
- clr-str-buf
- over 1+ dup rot
- expect length-s
- swap c! ;
-
-
- : input-filename
- str-buf
- 40 accept ;
-
-
- : abort-key ( --- )
- key drop ;
-
-
- : get_ofile_name ( --- )
- ofile
- clr-hcb
- ofile-msg
- input-filename
- str-buf
- ofile
- $>handle
- ;
-
-
-
- : open_ofile ( --- f )
- ofile
- hopen
- if
- cr open-err-msg
- cr retry-msg
- abort-key
- false
- else
- true
- then
- ;
-
-
- : GET-FILE ( --- f )
- get_ofile_name
- open_ofile
- ;
-
- Thanks for the help,
- M. Simon
-
- NET/Mail : RCFB Golden, CO (303) 278-0364 VESTA & Denver FIG for
- Forth! ---
- * The GrapeVine/Ferret Face BBS * NLR,ARK * 501-753-8121 DS *
- * PostLink(tm) v1.04 GRAPEVINE (#318) : RelayNet(tm) Hub
-
-
- -----
- This message came from GEnie via willett. You *cannot* reply to the author
- using e-mail. Please post a follow-up article, or use any instructions
- the author may have included (USMail addresses, telephone #, etc.).
- Report problems to: dwp@willett.pgh.pa.us
-