Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uakari.primate.wisc.edu!sdd.hp.com!mips!samsung!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!pitt!willett!ForthNet From: ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: BASIS Feedback Message-ID: <2761.UUL1.3#5129@willett.pgh.pa.us> Date: 13 May 91 11:57:08 GMT Organization: (n.) to be organized. But that's not important right now. Lines: 51 Category 10, Topic 35 Message 55 Sat May 11, 1991 R.BERKEY [Robert] at 10:57 PDT Mitch Bradley writes 91-05-06, in reference to Jan Stout's message of 91-05- 06: > > 8.2.0742 AT-XY > > Ok, now we can set the cursor, but how do we read it? > > You can't. A lot of terminals don't allow you to read the cursor > position, and to entitle a program to read the cursor position would > force the Forth implementation to interpose a software layer in the > output stream that would model exactly what the terminal is doing. > Hopelessly complicated, and of questionable value. Being able to save and restore the cursor position enables the coding of modular subroutines, for example, one that updates a time-of-day display, or a generic routine that displays "Press to continue". Code to track the cursor position I consider to be a routine implementation task, and a fairly easy one as drivers go. Say, for PRINTER-CR , a physical-level driver is: : (EPSON-CR) ( -- ) #CR (EPSON-EMIT) #LF (EPSON-EMIT) ; DEFER (PRINTER-CR) ' (EPSON-CR) IS (PRINTER-CR) A logical-level driver: VARIABLE COLUMN# VARIABLE LINE# VARIABLE PAGE# 66 CONSTANT #LINES/PAGE : PRINTER-CR ( -- ) 1 LINE# +! 0 COLUMN# ! LINE# @ #LINES/PAGE = IF 1 PAGE# +! 0 LINE# ! THEN (PRINTER-CR) ; Even with terminals that allow the cursor position to be read, I've found that complications in reading the terminal make the software approach preferable. Robert ----- 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 _or_ uunet!willett!dwp