home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / z3tips / z3tips05.lbr / WS4.NZT / WS4.NOT
Encoding:
Text File  |  1993-06-08  |  30.9 KB  |  539 lines

  1.  
  2. Z3TIPS05.LBR                                            Bill Tishey 10/24/87
  3.  
  4. I have compiled this series of notes/tips relating to ZCPR3 primarily from
  5. messages between users on Z-Node #3 (617-965-7259) and sysop Jay Sage.  Jay
  6. graciously provided me his message base for the effort.  Messages from other
  7. sources may also be included occasionally to expand on certain topics.
  8. --------------------------------------------------------------------------
  9.  
  10. WordStar 4.0 and Z-System
  11.  
  12.    1. Reviews 
  13.    2. Installation on Sanyo
  14.    3. Debugging WordStar
  15.    4. WS 4.0 Shelling
  16.  
  17. --------------------------------------------------------------------------
  18.  
  19. 1. Reviews
  20.  
  21.     09/27/87... I have WordStar 4.0.  The verdict: thumbs up! Particular 
  22. wins, in my view, are the properly functioning paragraph reformatting, 
  23. embedded rulers, improved WYSIWYG display, and vastly improved installation/
  24. tailoring facilities.
  25.                 No particular problems to far.  Haven't given it a real 
  26. workout yet.  It no longer includes SPELSTAR, but then I never had it before,
  27. either.  It includes instead what I gather is a well-regarded spelling checker 
  28. package, The Word Plus.  I think I like my own spelling checker better, but 
  29. then I haven't really worked this one yet, either.
  30.                 The 8" distribution (that's what I have - you get your 
  31. choice, of course) comes with SIX SSSD disks.  I can get the whole thing on 
  32. one of my DSDD disks, so i guess it comes to about 750k or so.  The dictionary
  33. alone is something like 120k, and there are some neat utilities that come 
  34. with it.
  35.                 The documentation is complete, and has a full index.  Being 
  36. very familiar with WordStar 3.0, I've hardly looked at it.  It's not like
  37. either the 3.0 or 3.3 stuff. It does contain both tutorial and reference.
  38.                 Yes, it's worth the money.  (Ken Wallewein)
  39.  
  40.     10/15/87... My first impressions of WS 4.0 were mixed -- the editor had 
  41. more nice features; but, the printer drivers didn't!  WS4 refused to default 
  42. to ".LQ OFF" and printer redirection appeared to be a 128 byte patch area 
  43. with scanty documentation.
  44.                 I got a call from MicroPro a couple of days ago to inform 
  45. me that WSCHANGE had a "bug" in it and that the ".LQ" and ".BP" flags had 
  46. switched places.   A little further checking showed me that WSCHANGE program 
  47. and the PATCH.LST file both agreed but WS4 was looking in the wrong place!  
  48. (Or maybe WS4 knew what it was looking for, but nobody else did)  Anyhow; 
  49. in the WS.COM file the ".LQ" toggle really lives at 0812H and ".BP" at 
  50. 0813H (switch those addresses in your PATCH.LST file).  And, when using 
  51. WSCHANGE, ".BP" is really  ".LQ"  and vice versa.  I still haven't figured 
  52. out why the auto page numbers at the bottom of the page sometimes are it 
  53. the opposite .LQ mode than the body of the text!
  54.                 My second problem was that I have an Olivetti PRAXIS serial  
  55. input typewriter that I use as my daisy wheel printer.  I am using an MSC-ICO  
  56. C/PM+ computer board, and with WS 3.3 I would exit WS and use DEVICE to 
  57. redirect the LST:  output to a serial port and then go back into WS and 
  58. print.   WS4 suggested that printer output redirection could be done from 
  59. within WS4.   For my C/PM+, at least, that means here's a 128 byte patch 
  60. area -- go for it!   So I did.  I spent an hour or so using SID to find 
  61. the SCB byte in high memory that redirected the LST: output and the values 
  62. for the devices my system supports.   Following is my assembly language 
  63. solution:
  64.  
  65. ;--------------------------------------------------------------------------
  66. ;ULPORT.MAC
  67.  
  68.     .Z80
  69.  
  70. ;"ULPORT" SUBROUTINE COMPARES WS4 PRINTER DRIVER TO "PRAXIS,0" DRIVER NAME,
  71. ;IF A MATCH IS FOUND THEN LOAD "RS2" (08H) USING "OUTRS2" TO SCB AND RETURN, 
  72. ;ELSE THEN LOAD "CEN" (40H) USING "OUTCEN" TO SCB AND RETURN,
  73. ;IF "PRAXIS" IS USED TO PRINT THEN USE "RETCEN" TO LOAD "CEN" TO 
  74. ;REINITIALIZE SYSTEM "LST:" OUTPUT
  75. ;
  76. ;THIS OUTPUT REDIRECTION IS FOR USE ON AN MSC-ICO Z-80 COMPUTER BOARD
  77. ;FOR WHICH THE SECOND SERIAL PORT (RS2) HAS BEEN INITIALIZED TO 300 BAUD,
  78. ;8 BIT WORD, 2 BIT STOP AND NO PARITY FOR MY OLIVETTI PRAXIX P-41 TYPEWRITER
  79. ;BY REWRITING "CPM3.SYS" (CPM3.SYS HAS ALSO BEEN CHANGED TO DEFAULT TO 
  80. ;1200 BAUD FOR THE FIRST SERIAL PORT -- SO THERE IS NO NEED TO RUN "DEVICE"
  81. ;IN "PROFILE.SUB" TO SET UP THE SYSTEM)
  82.  
  83.  
  84. SCBLST    EQU 0F5C7H    ;SYSTEM CONTROL BLOCK LST: REDIRECTION VECTOR ADDRESS
  85.                         ;THIS JRDII'S CP/M+ --- SO DON'T HOLD YOUR BREATH!!
  86. CEN    EQU 40H         ;LST: VALUE FOR SCB CENTRONICS REDIRECTION
  87. RS2    EQU 08H         ;LST: VALUE FOR SCB 2ND SERIAL PORT REDIRECTION
  88.  
  89.     ASEG        ;ABSOLUTE TO GET THE ADDRESSES
  90. ULPORT:    ORG    063BH    ;WS4 "PRNPAT" BEGINNING ULPORT:: CALLS THIS
  91.     PUSH    AF
  92.     PUSH    BC
  93.     PUSH    DE
  94. START:    LD    DE,DRIVER
  95. NEXT:    LD    A,(DE)
  96.     CP    (HL)
  97.     JR    NZ,OUTCEN
  98.     CP    0
  99.     JR    Z,OUTRS2
  100.     INC    DE
  101.     INC    HL
  102.     JR    NEXT
  103.  
  104. OUTRS2:    LD    A,RS2
  105.     LD    (SCBLST),A
  106.     POP    DE
  107.     POP    BC
  108.     POP    AF
  109.     RET
  110.  
  111. RETCEN:    PUSH    AF   ;ULUNPT:: CALLS THIS
  112.     PUSH    BC
  113.     PUSH    DE
  114. OUTCEN:    LD    A,CEN
  115.     LD    (SCBLST),A
  116.     POP    DE
  117.     POP    BC
  118.     POP    AF
  119.     RET
  120.  
  121. DRIVER:    DEFM  'PRAXIS',00
  122.  
  123.     END
  124. ;--------------------------------------------------------------------------
  125.  
  126.                  The ULPORT::  patch address should "CALL 06B3H" (PRNPAT::)  
  127. and ULUNPT:: should "CALL" the address that RETCEN: assembles to on your 
  128. system.  I have learned to routinely use many of the "new" features, although  
  129. I have not had a chance to use them all, and have usually been sucessful.  
  130. Print time formatting (.PF) looks like it could be a super tool.  My wife 
  131. writes a lot of documents that will be printed single spaced, but she likes  
  132. to proof then on a double spaced draft print.  Simple, just put ".PF" and 
  133. ".LS  2"  at the top of the document before it is printed (comment out the 
  134. ".LS  2"  while editing).   This idea sort of works, the document prints 
  135. double spaced;  BUT, WS4 will not recognize the ".LM x" commands she has put 
  136. in the text to indent paragraphs and phrases.  WS4 blithly prints using the 
  137. page setup defaults and everything comes out printed flush left -- I don't 
  138. know whether the problem is mine or WORDSTAR's!
  139.                 The new dictionary supplied with THE WORD PLUS is larger; 
  140. however, its vocabulary for "real writers" has diminished while its knowledge 
  141. of words used by "computer review writers" has been enhanced.  No thanks, 
  142. I'll stick to my old KAYPRO version!
  143.                 Except for the few problems that I have run into, I've been 
  144. pretty happy with WS4.   Some of the features that are on the IBM-PC version  
  145. (such as selective page printing) would be nice, but probably make it even 
  146. more of a memory hog and slower yet.  There are still some serious "bugs" 
  147. to be worked out yet, and I hope the solutions will be coming from MicroPro.
  148.  
  149.  
  150. 2. Installation on Sanyo
  151.  
  152.     07/26/87... I have started using a Z-Com system w/utilities on my Sanyo 
  153. 1200, and can get all my old CPM stuff to run except Wordstar.  This is not
  154. the usual problem with WS.OVL, but a new bug.  When I boot the pgm., all it 
  155. does is log the disk and freeze the keyboard.  The initial logo does not 
  156. even come up.  The copy I use came bundled and installed for the Sanyo 
  157. (install.com will not install any other terminal). I think it is looking
  158. for a specific RAM pattern that it cannot find w/the Z-Sys.  Does anyone 
  159. know of a patch, address, hammer, or etc. that I could use to fix this? 
  160. (Yes, it will run on my CPM, even out of FRONT51).  (Charles Dupree)
  161.  
  162.     07/27/87... The version of WS that comes with Kaypros has an added bit 
  163. of code in the patch area that runs on startup and exit.  What it does is 
  164. modify the system so that the Kaypro cursor keys are translated into the 
  165. WS values.  (^S ^E ^D ^X.)  Once this was removed, the program ran fine on 
  166. a 'normal' CPM machine.  If you have a list of the patch points for your 
  167. version of WS, take a look in that area and see if something similar has 
  168. been added.
  169.                 Part of the problem was the patch used Z80 code which hung 
  170. the machine, and part was that it was poking values into the OS which only 
  171. made sense with the Kaypro.  Hope this is of some help.  (larry Schnitger)
  172.  
  173.  
  174. 3. Debugging WordStar
  175.  
  176.     08/02/87... The beginning of your test procedure was fine, but don't 
  177. use the 'G' command.  That just starts the program running full speed.  
  178. You have to use the trace commands to follow program execution one step at 
  179. a time.  As I said before, be suspicious of any command that gets the 
  180. address at location 0001 and tries to use it to compute an offset address.  
  181. A typical sequence would be:
  182.     LHLD 0001           ; Get address of BIOS warmboot entry point
  183.     LXI D,nn            ; Offset to stuff we want to access
  184.     DAD D               ; Add the offset so HL points to it
  185. If you had a debugging tool like DSD, you could set complex breakpoints
  186. that would stop the code automatically on a reference to address 0001.
  187. If you still are not making progress, you could upload your WS.COM to the
  188. private area here, and I could take a quick shot at locating the problem
  189. (though I cannot promise to spend too much time at it).  (Jay Sage)
  190.  
  191.  
  192. 4. WS 4.0 and ZFiler
  193.  
  194.     09/29/87... I am having trouble getting WordStar 4 and Zfiler to work 
  195. properly together.  The macro command for going into WS, into Document 
  196. mode, and then opening a file, which worked fine with WS33, no longer 
  197. works properly.  (I am running Z33 with WS4 installed to work as a shell.
  198. The version of ZF that I am using is an earlier one--10B, I think.  Would 
  199. that make a difference, perhaps?)  What happens, when I give the macro 
  200. command with the pointer at the desired file, is that WS is loaded, but 
  201. instead of going into D mode and opening the file, WS gives me a warm boot 
  202. and the "strike any key to return to Word-Star" message as if I had just 
  203. "run" a program from the WS shell.  When I exit WS, I am returned to the 
  204. ZF shell properly.  If, instead of using the macro, I give the command 
  205. manually, using the Z command, it works properly (going into WS, editing, 
  206. and then coming back to ZF).  It looks like the command isn't getting 
  207. through via the macro.  I am using the same script that worked on WS33, 
  208. copied from one of yours, but very straightforward (no IFs and so on).  
  209. What am I doing wrong this time?  (Alan Campbell)
  210.  
  211.     09/29/87... The problem you report is very interesting.  What I 
  212. suspect is happening is that when command lines are put into the command 
  213. buffer by a ZFILER macro, the shell running message flag is still set.  
  214. Since WS now knows about shells, it tests that flag and decides (properly 
  215. based on the info it receives) that it has been invoked not as a user 
  216. program but as a shell.  You might want to try a recent version of ZFILER 
  217. to see if I did catch and fix such a problem (though I have no such 
  218. recollection).  If it does persist, I will have to put it on my list of 
  219. things to fix.  When I get a chance, I will try invoking some other shell, 
  220. like another copy of ZFILER or VMENU from a macro command line and see if 
  221. it also thinks it has been called up as a shell.  Thanks for the report.
  222. (Jay Sage)
  223.  
  224.     09/29/87... I just tried to reproduce the problem using ZFILER 1.0H 
  225. by invoking MENU and FM from macro commands, and I had no trouble.  My 
  226. copy of WS4 has still not arrived, so I cannot try the exact situation 
  227. you reported on.  Maybe things will work with the new ZFILER.  Otherwise, 
  228. there is a slight chance that there is a problem with WS4 (I would prefer 
  229. that the problem be with ZFILER, since that I can fix!).  (Jay Sage)
  230.  
  231.     09/30/87... Changing to ZF10H didn't make any difference, but in the 
  232. course of experimenting with it, I found out what was going wrong, I think.
  233. The script I was using was:
  234.        $d$u:;ws $f;$h:
  235. I may be remembering it wrong, but at any rate it was one that had worked 
  236. before, as I said.  Now it will work only if the final ";$h" is removed.
  237. WS 4 will now accept options on the command line ("p" for print directly,
  238. "n" for nondocument mode).  This is mentioned in the advance PR material, 
  239. but I haven't been able to find it in the documentation.  Nevertheless, 
  240. it is in effect.  Apparently what is happening is that that final parameter 
  241. is being expanded and then passed on to WS as "B0:".  The same undesirable 
  242. results can be reproduced by entering the whole thing in expanded form on 
  243. the command line.
  244.                 It seems that WS is being passed the expanded parameter, 
  245. taking it for an option, gagging on it, and then offering to "return" to its
  246. opening menu.  (I wonder if this would affect other programs that expect 
  247. options on the command line?)
  248.                 Removing that last parameter proved to be necessary in the 
  249. one for the "Z" macro, also, to get it to work correctly with WS4.  Actually
  250. I have never quite understood the necessity of that last "$h: since you are 
  251. returned to ZF whether it is there or not.
  252.                 Sorry to have put you to the trouble of checking this out.  
  253. I should have experimented more myself before calling for help.  Maybe no 
  254. changes will be necessary?  (Alan Campbell)
  255.  
  256.     09/30/87... Now it sounds as though it may be a WordStar problem.  
  257. Once there is a semicolon in the command line, WordStar should stop 
  258. reading (actually, the command processor only parses up to the semicolon, 
  259. so programs that use the command tail in the buffer at 80H do not know 
  260. about the rest of the command line.  Something sounds fishy about the way 
  261. WordStar is running under ZCPR3.  I will now be even more eager to get my 
  262. copy and look into this situation further.   (Jay Sage)
  263.  
  264.     10/01/87... While taking a shower a few minutes ago (isn't that one 
  265. of the best places to think), I hit on the explanation of the problem 
  266. you described.  WS4 is, unfortunately, acting like a TRUE shell (not the 
  267. way I would have written it).  When WS begins running, it installs itself 
  268. on the shell stack and checks to see if any commands are pending in the 
  269. command-line buffer.  If so, it executes them and only then begins its 
  270. own execution.  So, whenever there is any other command after the WS 
  271. command in the command line, you will enter WS from a shell with the 
  272. strike-any-key message.
  273.                 This is not how I would have written this.  One does not 
  274. really want WS to take over the command processor function.  It is 
  275. primarily an editor.  I think one of the following two approaches would 
  276. have been superior.  First, WS could have installed itself as a shell 
  277. only when the 'R' command was used.  Then it would have behaved correctly 
  278. for normal operations.  However, once the 'R' command was used, not only 
  279. would the user's new command be executed; any pending commands after WS 
  280. would also be run.  This would not be desirable.  
  281.                 The best approach would have been for WS to use the old 
  282. ZCPR2-style approximation to a shell.  When the 'R' command was used, 
  283. the command line entered by the user would have the WS command appended 
  284. to it followed by any other pending commands in the command line buffer.  
  285. The result would be placed into the command line buffer for execution.  
  286. In this way, pending commands would not be executed until the user exited 
  287. from WS.
  288.                 The way things are now, you cannot put WS in an edit/
  289. assemble/link alias, since the assembly and linkage will be performed 
  290. before the editing!!!  This is quite unfortunate.
  291.                 By the way, the reason for the $H: at the end of the 
  292. ZFILER macro is to maintain the user's default directory, i.e., to undo 
  293. the effect of the directory change $D$U:.  This may no longer be necessary, 
  294. since, I believe, I have made ZFILER keep track of its home directory on 
  295. the shell stack so that it will always return there no matter how many 
  296. times a macro or 'Z' command has changed it.  A second comment.  If WS 
  297. recognizes the DU form, try the macro "WS $P" instead of logging into 
  298. the directory.  Let me know if that works.  And thanks for all of your 
  299. comments.  (Jay Sage)
  300.  
  301.     10/01/87... So THAT is what was causing it!  Not very good news, for 
  302. as you say if no additional commands can safely be put after "ws fn," 
  303. it won't be possible to use complicated aliases.  For simple "edit this 
  304. file" type of commands, of course, leaving off any additional commands is 
  305. a kind of solution.
  306.                 Would it be possible to get around this by using 
  307. interactive commands via ZEX?  Or would subsequent commands cause trouble 
  308. even there?  Or could something be done with GET and GO?
  309.                 You wondered whether WS4 recognizes DU commands.  Yes it 
  310. does--even under straight CP/M, apparently.  And that raises the 
  311. possibility of another solution, albeit a somewhat dirty one.  I tried 
  312. WS4 under ZCPR3.0, without running Z-RIP on it, and the problem we have 
  313. been talking about did not occur (I will have to recheck this).  Perhaps 
  314. it could be used under Z33 without telling it about ZCPR during the
  315. installation process (or perhaps it could be patched so that Z33 does 
  316. not autoinstall it?).  
  317.                 Not running WS4 as a ZCPR33 shell would be a kind of
  318. solution, though it would defeat the purpose that a lot of people have
  319. been talking about.  I wonder what would be lost, actually?  The 
  320. only things the user is made aware of are named directories.  These
  321. show up in the directory listing on the opening menu, but they are not
  322. shown on the status line during editing.  Of course DIRs are recognized 
  323. by WS4 in commands, and that would be lost, too.
  324.                 I suppose there are other, transparent things that would 
  325. be lost, but the DU feature would still be there.  Would recognition of 
  326. the path in R commands to run other programs be lost, too, or is that 
  327. controlled by ZCPR?  That could be a serious loss!  
  328.                 I look forward to hearing what you come up with after 
  329. you get your copy!  In the meantime, I will try the command "ws $p," 
  330. and let you know what happens.  (Alan Campbell)
  331.  
  332.     10/01/87... My copy of WS4 was waiting for me when I got back from 
  333. work today.  Unfortunately, I am going to be extremely busy for the next 
  334. couple of weeks and will probably not have a chance to look at it.
  335.                 It sounds as though a little work with a disassembler and 
  336. patcher are going to be in order.  And a letter to MicroPro so release 5 
  337. will be better.  Perhaps if I had been involved in the testing before 
  338. release I would have caught this.  Of course, Echelon and MicroPro wrote 
  339. it exactly as a shell should be.  Trouble is, WordStar should not be a 
  340. shell!  It should be a self-chaining program.  I am sure that with a 
  341. debugger one can easily defeat the shelling.  Provided one can enter 
  342. multiple command lines from the 'R' command, one can simply append a 
  343. ";WS etc" to each command if one really wants to return to WS.  (Jay Sage)
  344.  
  345.     10/02/87... Thanks for your messages.  I did try WS $P, as you 
  346. suggested, but the results were the same.  I also tried to fool WS by 
  347. using an embedded Alias, but of course WS gobbled up the remainder of 
  348. the main alias and ran any following commands.  (I admit I should have 
  349. expected this after reading your explanation, but it is fun to experiment.)
  350.                 You can indeed RUN multiple commands from within WS.  
  351. You can also run RCP commands (the manual gives the impression that you 
  352. can't).  It will be interesting to see what you come up with when you get
  353. around to trying the patch you mentioned.  I myself am going to try to get 
  354. this out of my mind and go on to a more exciting project (the system 
  355. reconfiguration you discussed in the last issue of TCJ).  (Alan Campbell) 
  356.  
  357.     10/06/87... (Raising hand as person responsible for WS4's shell 
  358. behavior)  There are three alternatives for folks who are inconvenienced 
  359. by WS4's shell capabilities.  The first is: use it!  The combination of 
  360. the <esc> macros in WS4 plus an R command that can do anything allows you 
  361. to do many of the things now being done by MENU, etc.
  362.                 Another alternative is to deliberately load up your shell 
  363. stack so it is full when WS is invoked.  If WS sees the shell stack is full, 
  364. it will not behave as a shell, since it can't install itsef as one.  This 
  365. is easy to do with multiple invocations of HSH or z/vfiler, and retains the 
  366. other ZCPR3 features of named directories and path search for overlays.
  367.                 The most drastic step is to patch WS.COM so it will no 
  368. longer be recognized as a ZCPR3 utility and not auto-installed by ZCPR 3.3 
  369. or Z3INS.  It won't behave as a shell at all if you do this, but you'll 
  370. also lose the other ZCPR3 features.  (Dave McCord)
  371.  
  372.     10/15/87... Hi, I noticed your messages a few weeks ago about having 
  373. problems with WS4's shell capability.  Just wanted to second the motion.  
  374. I am _extremely_ disturbed that WS4 has come out this way; it is most 
  375. unfortunate.  I have a very important WS application which I would use 
  376. daily in which I would like to run WS4 from an alias.  Just can't be 
  377. done.  Neither of the three suggested alternatives really make any sense 
  378. for us.
  379.                 One of the things I always did with NewWord is set up a 
  380. 'shell loop' between running it and patching it with its 'install' program, 
  381. NWINSTAL (comparable to WINSTALL):
  382.          
  383.                 SHSET NWINSTAL NW;NW;CMD
  384.          
  385.                 Now this won't work with WS4 either.
  386.          
  387.                 It's really too bad that WS4 was created this way.  It seems 
  388. that the disadvantages easily outweigh the advantages.  (Rick Charnes)
  389.  
  390.      10/16/87... Yes, I think a lot of other people are going to be very 
  391. displeased once all the implications become clear.  I am not a programmer,
  392. myself, but my little bit of experience with assembling Z-System files has 
  393. shown me what a convenience an "edit--assemble--link" alias can be.
  394.                  My own uses would be limited to something really simple 
  395. like edit--spellcheck--print.  WS4's print-and-exit command line option would 
  396. make that easy were it not for its behavior as a shell.  
  397.                  Perhaps someone will come up with a patch that will make 
  398. WS4 behave as described by Jay (not a shell but a self-chaining program) in a 
  399. way that will let us have the advantantages of ZCPR interaction without the 
  400. disadvantages?  I hope so.
  401.                 In the meantime, the last of the three suggested ways of 
  402. using the program seems to me to be the only viable one.  I don't see how 
  403. WS4's macro feature combined with its ability to RUN programs can
  404. give anything like the power and flexibility of aliases.  If it can,
  405. I would like to see it demonstrated.
  406.                 As for the second suggestion, how would that 
  407. work?  If the shell stack is full, would WS cease to function as a
  408. shell but still have all the other ZCPR features, as suggested?  That
  409. would be nice, but would you have to fill the shell stack every time 
  410. you loaded WS?  Would other shells such as ZFILER or MENU still work?
  411. Could you make stack-stuffing part of an alias?  I am afraid that this
  412. is a bit over my head.
  413.                 The third method would be like going back to WS33 or new 
  414. word, but with a few new features.  Recognition of DUs would still be there.
  415. WS doesn't do much with named directories, and for people like me with small 
  416. systems, DUs alone are ok, I suppose.  The real loss would probably be 
  417. path-search for overlays, and doesn't Public ZRDOS take care of that?  
  418. (With only two floppies, these considerations don't mean too much to me, 
  419. but I can see that they would to most others.)  
  420.                 Hope we don't have to wait for version 5 for a solution to 
  421. this mess.  (Alan Campbell)
  422.  
  423.     10/17/87... I have been hunting around in the WS.OVR file for the code 
  424. that handles the shell stack and command line buffer.  I think I have located 
  425. the code but have not had the time to completely decipher what is going on.  
  426. In the process of doing this, I thought of a simple, though imperfect, 
  427. solution to the problem.  First I wrote a patch to do this using the INISUB 
  428. and UNISUB routines in WS4, but then I decided it was better to handle it 
  429. with alias scripts.  The basic idea is to turn off the shell stack while WS4 
  430. is running by setting the number of stack entries in the ENV descriptor to
  431. 0 temporarily.  Make the following ARUNZ alias:
  432.  
  433.                 WS0 POKE (ENV+20H) 0;WS $*;POKE (ENV+20H) 4
  434.  
  435. Replace the expression (ENV+20H) with the address of the environment
  436. descriptor in your system plus 20H.  When you want to run WS with shelling
  437. shut off (such as in a multiple-command alias script), just refer to WS0
  438. instead.  For normal operations you can still use WS and get the full
  439. capabilities, such as the ability to pass multiple command lines to WS4.
  440. This is lost when the shell stack is disabled.  I will try to figure out a
  441. way to really fix the problem some time.  (Jay Sage)
  442.  
  443.     10/17/87... With the shell stack disabled, the 'R' command works fine 
  444. for me so long as I select a command that can be loaded by WS to 100H and 
  445. run.  If you specify a type-3 COM file, there will be a disaster (that is 
  446. another reason for adding the protection of TYPE3HDR.Z80 to those programs).
  447.                 I would strongly recommend my solution of setting the 
  448. number of shell entries to 0.  That does not interfere with any shells 
  449. currently running and works whether or not a shell is in effect at the time 
  450. the alias is invoked.  It seems to me that your alias will not work if no 
  451. shell is loaded at the time it is invoked.
  452.                 I will take another look at the WS code and see if I can 
  453. figure out how to turn off shells in the code and change the 'R' command 
  454. to jam the new user command, along with ';WS' in front of any existing 
  455. commands in the multiple command line buffer.  It may be hard to find the 
  456. room to do this, and it is not easy work to deal with code stashed into 
  457. overlays (and with no source code).  Hawley's REVAS3 may do the trick, 
  458. however.  (Jay Sage)
  459.  
  460.     10/17/87... I'm about to upload a prepared message that solves the 
  461. problem in exactly the same way Jay's message just now does.  Yeah, the 
  462. idea is basically "stack-stuffing" as you suggest in your message.  I think
  463. Dave's suggestion that the combination of the WS4 <ESC> macros with the "R" 
  464. command gives it something like the power of MENU.COM is a bit optimistic, 
  465. since it has no provision for automatically including a standard filename 
  466. in any 'macro command line', such as MENU.COM does with system files.  
  467. Though you know the more I think about it, it sounds like it might be fun 
  468. to play with.  Just use that <ESC> macro screen as your 'menu screen'.  
  469. I'll play with it.  
  470.                 I think having two versions - one shelling and one without 
  471. (having filled the shell stack with an alias) -- might be a good way to go.
  472. Yes, with the stack-stuffing solution you _do_ still have the other
  473. ZCPR features such as NDR's and pathing.  (Rick Charnes)
  474.  
  475.     10/17/87... After being upset for a while about the difficulties in 
  476. running WS4 from inside a ZCPR3 multiple command line and feeling 
  477. dissatisfied with the solutions heretofore proferred, I came upon a solution 
  478. that I feel works quite well.  Dave McCord noted that if WS4 finds the 
  479. shell stack full at the time it is invoked it will not behave as a shell.  
  480. As far as I'm concerned this is precisely what I want.  He suggested 
  481. deliberate multiple invocations of HSH, Z/FILER, etc. to overload the shell 
  482. stack.  This takes too much time and is both awkward and inelegant.  Here's a 
  483. better solution, as in this alias WSTEST:
  484.               
  485. WSTEST poke fe20 01 80;echo loading wordstar;ws $*;  <<
  486. echo exiting wordstar;poke fe20 04 20
  487.               
  488.                 In the standard Echelon Z packages FE20h and FE21h are the 
  489. two bytes in the system environment that hold respectively the number of 
  490. elements in the shell stack and the number of bytes per stack.  
  491.                 So, assuming HSH or other history shell remaining loaded 
  492. in the background (1 shell element) we temporarily turn our system into one 
  493. with only one element 128 bytes in length, (01 80).  WordStar then loads 
  494. fine -- AS A NON-SHELL -- and then upon exit we return to our standard 4 
  495. elements of 32 bytes each (04 20).
  496.                 Normally when you have a shell anywhere in an alias it will 
  497. insist on executing all commands in the alias -- EVEN THOSE OCCURRING AFTER 
  498. IT ON THE COMMAND LINE -- before it will itself run.  Without the above 
  499. POKEing we would see the "EXITING WORDSTAR..." message before WordStar 
  500. loads!  However, once we've POKEd FE20 01 80 WordStar no longer behaves 
  501. as a shell and will load itself assertively in the command line.  The 
  502. "R" command, however, will not work and seems to lock up my system.  
  503.                 Note, by the way, that we are only able to do this because 
  504. WordStar *is able to* run as a non-shell as of course it does under a 
  505. straight CP/M system.  If, however, you try substiting ZFILER or VMENU or 
  506. other shell in the above alias you will be politely presented with a "SHELL 
  507. STACK FULL" error message and exit.  (Rick Charnes)
  508.  
  509.     10/18/87... Thanks for your suggestion that setting SHSTKS in the 
  510. environment module to 0 will not interfere with any shells previously 
  511. running.  I'll try your alias.  (Rick Charnes)
  512.  
  513.     10/21/87... Peter Mireau from MicroPro, the major author of WS4, spoke 
  514. to our combined BAMDUA/BAKUP (Morrow/Kaypro) meeting last night.  I asked 
  515. him about the problem with WS4 spitting out a string of U's when it exits.  
  516. He said he didn't know what the problem could be and had never heard it 
  517. before.  He said that his first thought, though, was that it was a problem of
  518. WS4 not 'de-shelling' correctly ---- and that is precisely my instinct as 
  519. well.  I don't know what more to say other than that I feel WS4's shelling 
  520. could have been handled better.  MicroPro pretty much relied on Echelon to 
  521. handle that side of the matter.  (Rick Charnes)
  522.  
  523.     10/22/87... Only the very first byte of the shell stack space has to 
  524. have a 00 to clear the stack.  The U's are probably the result, as you say, 
  525. of the way your machine is initializing memory.  It should cause no problem.
  526.                 Should!  Unfortunately, there do seem to be some further 
  527. insidious errors in the shell coding in WS4, and I have had the experience 
  528. of WS sending my machine into endless loops of garbage commands.  Once a 
  529. shell stack gets filled with something that one cannot stop and get a 
  530. 'command in edge wise' as it were, only the red button will stop things.
  531.                 I have tried to decipher the code in WS.OVR, but that is a 
  532. very difficult job, and I have the feeling my time is better spent on other 
  533. tasks.  It really is a shame the Z coding was so badly botched.  I hope 
  534. Dave McCord will have some feeling of remorse and (since he presumably has 
  535. the source) that he will figure out and release a patch to eliminate all use 
  536. of the shell stack and do everything with command chaining.  (Jay Sage)
  537.  
  538. --------------------------------------------------------------------------
  539.