Newsgroups: comp.sys.handhelds Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!news.cs.indiana.edu!rsg1.er.usgs.gov!rsg1.er.usgs.gov!stevev From: stevev@greylady.uoregon.edu (Steve VanDevender) Subject: HP48 improved ten-line stack display Message-ID: Sender: news@rsg1.er.usgs.gov Organization: University of Oregon Chemistry Stores Distribution: comp Date: 26 Mar 91 20:08:05 I picked up the ten-line stack display program 'STKV' last night, and I liked it but for a few small bugs. One is that since list concatenation takes precedence over string concatenation, a list on the stack would appear as: { 1 ": " foo bar baz } instead of 1: { foo bar baz } The other potential bug was that the program assumed you have a 131 x 64 PICT, so if your PICT was larger, it would write into the upper left of a larger PICT but display the PICT centered. It was also not nearly as tightly written as it could be, so here is my improved version of STKV: STKV: checksum #22013d, 172.5 bytes %%HP: T(3)A(D)F(.); \<< IF DEPTH @ if anything's on the stack THEN PICT RCL @ recall the current PICT GROB PICT PURGE @ purge the PICT; a new 131x64 PICT will be created 1 DEPTH 2 - 10 MIN @ view up to 10 levels or as many as there are if less FOR j PICT #0d @ push PICT and x-coordinate of display line #60d j #6d * - @ calculate y coordinate of stack line 2 \->LIST @ and put coordinates in list j ": " OVER @ get j and the string it will be added to, copy j 5 + PICK \->STR @ get stack object in level j and convert to a string + + @ concatenate j, ": ", string of level j 1 \->GROB @ make into a GROB with smallest font REPL @ place in PICT NEXT { } PVIEW @ display PICT in scrolling mode (but it won't scroll) PICT STO @ restore old PICT END \>> -- Steve VanDevender stevev@greylady.uoregon.edu "Bipedalism--an unrecognized disease affecting over 99% of the population. Symptoms include lack of traffic sense, slow rate of travel, and the classic, easily recognized behavior known as walking."