home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / zcpr33 / zcolumns.lbr / FOREVERZ.OZ7 / FOREVERZ.O87
Encoding:
Text File  |  1988-02-25  |  17.9 KB  |  611 lines

  1. FOREVER Z, for Morrow Owners Review
  2. by Rick Charnes
  3. 1165 Shotwell St.
  4. San Francisco, CA 94110
  5. 826-9448
  6. approx. 2800 words
  7.  
  8. Copyright (c) 1987 by Rick Charnes.  All rights reserved.
  9. SUBMISSION DATE: 8/17/87
  10.  
  11. [This column appeared in two segments: in the October/Novemberáì
  12. 1987 issue, and then in the final MOR issue before its (*sob*)áì
  13. demise, December 1987/January 1988.]
  14.  
  15. áì
  16. First things first. WordStar 4.0, which will be released by theáì
  17. áì
  18. time you read this, has a number of excellent featuresáì
  19. áì
  20. specifically tailored for us ZCPR3 users. This reflects theáì
  21. áì
  22. superb hand of Dave McCord, Echelon's chief technician andáì
  23. áì
  24. creator of the Morrow bootable disk. Dave has been working witháì
  25. áì
  26. MicroPro on this and the resulting product is now the most ZCPR3-áì
  27. áì
  28. enhanced major CP/M-compatible application program that we have.áì
  29. áì
  30. Files can now be referenced either from the command line witháì
  31. áì
  32. their named directory reference; i.e., "A0:COMMAND>WSáì
  33. áì
  34. LETTER:SYLVIA.LTR". Both the "D" (edit a document) and L)og a newáì
  35. áì
  36. directory commands will accept a named directory. The currentlyáì
  37. áì
  38. logged named directory is also displayed at the opening menuáì
  39. áì
  40. along with the DU: designation, adding a very nice touch.áì
  41.  
  42.  
  43. WordStar's R)un a program command has had its power greatlyáì
  44. áì
  45. increased under ZCPR3. It fixes a major problem that previouslyáì
  46. áì
  47. existed for us, viz. it could not previously run a non-COM-fileáì
  48. áì
  49. alias. This of course means ARUNZ/ALIAS.CMD entries, which is theáì
  50. áì
  51. main way we are making aliases. Since such a large part of ouráì
  52. áì
  53. work from the command line consists of referencing ALIAS.CMDáì
  54. áì
  55. aliases, WordStar can now be used very much like a one-time ZCPR3áì
  56. áì
  57. shell. Additionally, we can now run any resident commands such asáì
  58. áì
  59. REN, SAVE, ERA, etc. from the R) command. Note that this onlyáì
  60. áì
  61. works for ZCPR3 users; CP/M users (poor souls) cannot runáì
  62. áì
  63. resident commands and are still limited to executing .COM files.áì
  64.  
  65.  
  66. Finally, if you never got the hang of ZRDOS' public directoryáì
  67. áì
  68. feature (shame on you!), WordStar will now search along ZCPR3áì
  69. áì
  70. path for its overlay files, a very nice touch that rounds off theáì
  71. áì
  72. superb work MicroPro has done towards "Z-ifying" this excellentáì
  73. áì
  74. product.áì
  75.  
  76.  
  77. I'd like now to describe two of the most innovative of the newáì
  78. áì
  79. programs hot off the ZCPR3 presses and available from Z-Nodeáì
  80. áì
  81. BBSes everywhere.áì
  82.  
  83.  
  84. The brilliantly unorthodox nature of the programming work done byáì
  85. áì
  86. Mr. Dreas Nielsen of Corvallis, Oregon has always impressed meáì
  87. áì
  88. profoundly. He works in a realm more or less neglected by otheráì
  89. áì
  90. programmers, dealing with what might be called [START BOLD]non-áì
  91. áì
  92. menu[END BOLD] shells and shell variables. Some of you may haveáì
  93. áì
  94. experimented with his exotic and brilliant QUEUE.LBR which heáì
  95. áì
  96. wrote in the very earliest days of ZCPR3 when even [STARTáì
  97. áì
  98. UNDERLINE]ZCPR3: The Manual[END UNDERLINE] was unavailable. Itáì
  99. áì
  100. was an extraordinarily sophisticated technique that would placeáì
  101. áì
  102. filenames in a "queue" to be executed one by one by a user-áì
  103. áì
  104. specified command or series of commands. The utilities he usedáì
  105. áì
  106. when he wrote this 2 1/2 years ago -- SH, SHSET, SHVAR, SHDEFINEáì
  107. áì
  108. -- remain even today unappreciated and unused by the vastáì
  109. áì
  110. majority of ZCPR3 computerists.áì
  111.  
  112.  
  113. Following these chronologically in Mr. Nielsen's pantheon was theáì
  114. áì
  115. release of his superb GETVAR/RESOLVE duo, with which one is ableáì
  116. áì
  117. to store (GETVAR) and then reference (RESOLVE) a named variableáì
  118. áì
  119. based on user input given in response to program query. I hope toáì
  120. áì
  121. be able to go into these important programs in a future column.áì
  122.  
  123. áì
  124.  
  125. More recently he has done superb work in enhancing SH.COM andáì
  126. áì
  127. SHVAR.COM, two of the early ZCPR3 non-menu shells. And finally,áì
  128. áì
  129. as his crowning glory, Mr. Nielsen has now graced us with hisáì
  130. áì
  131. elegant FOR/NEXT/PERFORM series, contained within the libraryáì
  132. áì
  133. FORNXT2.LBR. These programs give the 8-bit world something whicháì
  134. áì
  135. we have never previously had, "FOR/NEXT" looping [START BOLD]fromáì
  136. áì
  137. the command line[END BOLD]. Those programmers among you willáì
  138. áì
  139. understand the significance of this particular form of syntax. Itáì
  140. áì
  141. is actually a refinement and culmination of the basic conceptáì
  142. áì
  143. Dreas started in 1985 with QUEUE.LBR. As the ZCPR3 world hasáì
  144. áì
  145. progressed and more sophisticated tools have become available,áì
  146. áì
  147. programmers such as Mr. Nielsen have been able to use these toolsáì
  148. áì
  149. as building blocks from which they may go on and create even moreáì
  150. áì
  151. elegant concepts, and FORNXT2.LBR is his gift to us.áì
  152.  
  153.  
  154. The purpose of these programs is to generate a list ofáì
  155. áì
  156. "arguments" upon which any number of possibly unrelated commandsáì
  157. áì
  158. are then executed (PERFORMed). In one of its simplestáì
  159. áì
  160. applications, the arguments would be a list of filenames.áì
  161. áì
  162. Suppose, for example, you're writing a book and today is the dayáì
  163. áì
  164. to put the finishing touches on your last four chapters, each ofáì
  165. áì
  166. which exists as a separate file on your disk. For each (usingáì
  167. áì
  168. FOR.COM, get it?) of these files, you want to edit it witháì
  169. áì
  170. NewWord and then run it through both CORRECT-IT and GMK.COMáì
  171. áì
  172. ("Grammatik", checks for grammar, style, punctuation, etc.).áì
  173. áì
  174. Since your editor is one of those unlucky persons with one ofáì
  175. áì
  176. those obsolete IBM PC's, you have to run them through FILTW.COMáì
  177. áì
  178. to strip out all non-ASCII codes. Then finally before you turnáì
  179. áì
  180. your computer off for the night you want to archive each file toáì
  181. áì
  182. your backup floppy. This is all a fairly ordinary flow ofáì
  183. áì
  184. procedures for many writers.áì
  185.  
  186. áì
  187.  
  188. But it sounds like a great deal of repetitive keyboard work, aáì
  189. áì
  190. lot of the same commands to remember for each file, right?  OK,áì
  191. áì
  192. let's put our ZCPR3 thinking caps on. We're smart and we know weáì
  193. áì
  194. could write an alias including all of the above commands. Butáì
  195. áì
  196. that would still entail running the alias four times, once foráì
  197. áì
  198. each file. We are really enraptured by the Muse today and don'táì
  199. áì
  200. want to be bothered by all that computer-izing. Well, if all theáì
  201. áì
  202. files have a similar name, such as CHAPTER.016, CHAPTER.017, etc.áì
  203. áì
  204. we'd know what program would take care of this: Steve Cohen'sáì
  205. áì
  206. W.COM. Standing for W)ildcard, W.COM gives programs acceptingáì
  207. áì
  208. only unambiguous parameters the ability to accept themáì
  209. áì
  210. wildcarded. We'd simply write our alias, called say, WRITE, enteráì
  211. áì
  212. "W WRITE CHAPTER.*", and off we'd go.áì
  213.  
  214.  
  215. But suppose the chapters of our autobiography are named, foráì
  216. áì
  217. instance,  after the various cities in which we've lived, and theáì
  218. áì
  219. filenames are therefore unrelated?  Try this on for size, and getáì
  220. áì
  221. a sample of FOR/PERFORM:áì
  222.  
  223.  
  224. FOR CHERHIL BOSTON GLOCSTER FRISCOáì
  225. PERFORM ECHO PROCESSING $X...$|NW $X$|CORRECT $X$|GMK $X$| <<áì
  226. FILTW $X$|AC $X BACKUP: /Aáì
  227.  
  228.  
  229. Quite a mouthful, but this command line could easily take usáì
  230. áì
  231. through the entire day's computing. We're all running HSH, ofáì
  232. áì
  233. course, the command line editor, so any mistakes in entering areáì
  234. áì
  235. easy to correct. Let's go through it slowly.áì
  236.  
  237.  
  238. The initial 'FOR' line creates the list of "arguments," in thisáì
  239. áì
  240. case filenames (could be entire command lines!), and places themáì
  241. áì
  242. into a file called FORFILES.SYS that is automatically created byáì
  243. áì
  244. FOR.COM. This is a "system" file (has its $SYS attribute turnedáì
  245. áì
  246. on) so a directory display will not ordinarily show it, butáì
  247. áì
  248. that's fine with us. We could if we wished look into FORFILES.SYSáì
  249. áì
  250. with an editor and we would see a text file consisting simply ofáì
  251. áì
  252. the four files we entered as parameters.áì
  253.  
  254.  
  255. Now for PERFORM. PERFORM.COM reads the list contained withináì
  256. áì
  257. FORFILES.SYS and in our case substitutes each file, one by one,áì
  258. áì
  259. into the parameter symbol'$X' in its own command line. It's veryáì
  260. áì
  261. similar to the usual parameter symbols '$1', '$2', etc. usedáì
  262. áì
  263. elsewhere. If you look closely, however, you'll see an odd-áì
  264. áì
  265. looking symbol, '$|'. The symbol is a "substitute multiple-áì
  266. áì
  267. command separator."  It is PERFORM.COM's substitute for theáì
  268. áì
  269. normal ZCPR3 semicolon (';') used for separating commands in theáì
  270. áì
  271. ZCPR3 multiple command line buffer. Remember: we're not at the ì
  272. áì
  273. system level; we're still working inside an application andáì
  274. áì
  275. applications have their own rules and symbols. It may look likeáì
  276. áì
  277. we are stringing together a series of separate commands for theáì
  278. áì
  279. regular ZCPR3 command line buffer, but appearances are deceiving.áì
  280. áì
  281. Everything on that command line is really simply parameters foráì
  282. áì
  283. PERFORM.COM.áì
  284.  
  285.  
  286. We therefore need some way of telling PERFORM that it shouldáì
  287. áì
  288. consider all our seemingly separate commands as input for it toáì
  289. áì
  290. process.  We do this with the '$|' symbol. In the above line whenáì
  291. áì
  292. you see a '$|' flush right against a '$x', keep in mind that theyáì
  293. áì
  294. are really not together; the former symbol is simply acting toáì
  295. áì
  296. separate what precedes it from what follows it. When PERFORM doesáì
  297. áì
  298. its marvelous work of substituting each of the files ináì
  299. áì
  300. FORFILES.SYS one at a time wherever it sees the '$x' symbol, itáì
  301. áì
  302. also will translate each '$|' into a semicolon. Each time itáì
  303. áì
  304. loops through our entire sequence of commands, it does the twoáì
  305. áì
  306. substitutions -- a filename for '$x' and a ';' for '$|'. It THENáì
  307. áì
  308. sends this "resolved" command line over to the command processoráì
  309. áì
  310. proper and runs it.áì
  311.  
  312.  
  313. All this activity is said to take place on the "shell stack" andáì
  314. áì
  315. '$x' is then called a "shell variable."  PERFORM.COM placesáì
  316. áì
  317. itself on this shell stack, just as do our more familiar "menu"-áì
  318. áì
  319. based shell utilities, VFILER, VMENU, and MENU. One easy way toáì
  320. áì
  321. see this visually is by simply adding the command 'SHOW' anywhereáì
  322. áì
  323. in the above line. When SHOW.COM loads choose the "S" option andáì
  324. áì
  325. you will be given a "real-time" view of what the shell stackáì
  326. áì
  327. looks like.áì
  328.  
  329.  
  330. So now we're beginning to see what will happen. On the first loopáì
  331. áì
  332. through, our command line will have resolved to:áì
  333.  
  334.  
  335. ECHO PROCESSING CHERHIL...;NW CHERHIL;CORRECT CHERHIL; <<áì
  336. GMK CHERHIL;FILTW CHERHIL;AC CHERHIL BACKUP: /Aáì
  337.  
  338.  
  339. This command line in itself will keep us busy for quite a while,áì
  340. áì
  341. but of course when it finishes it will move us automatically onáì
  342. áì
  343. to BOSTON and the rest, repeating the entire series. We may spendáì
  344. áì
  345. two or three hours inside of NewWord working on each file. Alláì
  346. áì
  347. the while the above command sequence is sitting patiently in theáì
  348. áì
  349. command line buffer, waiting for us to exit. When we do, it isáì
  350. áì
  351. immediately ready and available to go to work for us with theáì
  352. áì
  353. next command.áì
  354.  
  355.  
  356. This is really a very simple use of these tools, nor does it evenáì
  357. áì
  358. require NEXT.COM. FOR can create a list not just of files but ofáì
  359. áì
  360. all user areas, named directories, command lines, or simplyáì
  361. áì
  362. integers up to a user-specified limit, all capable of being actedáì
  363. áì
  364. upon by PERFORM. This combination provides a very powerfuláì
  365. áì
  366. command structure with which we can greatly automate many of ouráì
  367. áì
  368. operations, and I am very grateful to Mr. Nielsen for hisáì
  369. áì
  370. bountiful work.áì
  371.  
  372.  
  373. While we're exploring the command line buffer this is a good timeáì
  374. áì
  375. to make a quick digression into explaining it as one of theáì
  376. áì
  377. fundamental differences between ZCPR3 and CP/M. When a warm bootáì
  378. áì
  379. occurs in either CP/M or ZCPR3 a fresh and virgin copy of theáì
  380. áì
  381. command processor is loaded from disk. The significance of thisáì
  382. áì
  383. is as follows: in CP/M the command line resides directly in theáì
  384. áì
  385. command processor. When a warm boot takes place, such as when aáì
  386. áì
  387. program exits, this therefore flushes (wipes out) the commandáì
  388. áì
  389. line. This is why CP/M 2.2 cannot support multiple commands. Witháì
  390. áì
  391. ZCPR2 and ZCPR3 the command line was [START BOLD]removed[ENDáì
  392. áì
  393. BOLD] from its location in the command processor and placed in aáì
  394. áì
  395. specially protected area of memory known as a buffer. This wayáì
  396. áì
  397. the command line can maintain its integrity across warm boots andáì
  398. áì
  399. return as we like to do our bidding.áì
  400.  
  401.  
  402. I'd also like here to pass on a tip that I have found veryáì
  403. áì
  404. helpful in a number of circumstances in which I need to debug aáì
  405. áì
  406. command script I have written. It's ideal for aliases insideáì
  407. áì
  408. ALIAS.CMD, macro scripts in VFILER.CMD, MENU.VMN, etc. and asáì
  409. áì
  410. well with our PERFORM command line in case something had goneáì
  411. áì
  412. wrong. What we do is load the ZCPR3 program MU3 (Memory Utility)áì
  413. áì
  414. prior to anything else on the line. Once MU3 loads, we can thenáì
  415. áì
  416. scan to the aforementioned special area in memory (the commandáì
  417. áì
  418. line buffer) where our command line is kept, and simply view it.áì
  419. áì
  420. The beauty of this technique is that even though MU3 is the firstáì
  421. áì
  422. command in the line, the command line will have already beenáì
  423. áì
  424. built/generated by the time MU3 loads, and all the rest ofáì
  425. áì
  426. commands have already been placed in the buffer and we are ableáì
  427. áì
  428. to see the finished product. We see exactly what the commandáì
  429. áì
  430. processor sees and therefore our job of debugging is made mostáì
  431. áì
  432. easy.áì
  433.  
  434.  
  435. In our customized Morrow Z-System configurations the MCLBáì
  436. áì
  437. (multiple command line buffer) is precisely at location FF04 ináì
  438. áì
  439. memory. So we precede our line with 'MU3 FF04' where 'FF04' is aáì
  440. áì
  441. parameter to MU3, and this takes us directly to where we wish toáì
  442. áì
  443. go. In aliases it should be placed as the very first item. In theáì
  444. áì
  445. above example and any example with shell variables, however, weáì
  446. áì
  447. want to see the buffer [START BOLD]after[END BOLD] PERFORM oráì
  448. áì
  449. whatever shell processor we are using has substituted itsáì
  450. áì
  451. variables and transformed '$|' into ';', so we put it as the veryáì
  452. áì
  453. first item in PERFORM's command line:áì
  454.  
  455.  
  456. PERFORM MU3 FF04$|ECHO PROCESSING $X....áì
  457.  
  458.  
  459. Note that positioned thusly PERFORM processes MU3 as one of itsáì
  460. áì
  461. parameters, even though it's not a variable. The use of theáì
  462. áì
  463. command line separator '$|' ensures that it resolves all commandáì
  464. áì
  465. line parameters in one pass, so MU3 is "resolved" along with theáì
  466. áì
  467. variables and we are allowed to peek into the fully expandedáì
  468. áì
  469. command line. The use of MU3 as a debugging tool has tremendousáì
  470. áì
  471. general applicability; in most circumstances we needn't concernáì
  472. áì
  473. ourselves with the above matters.áì
  474.  
  475. áì
  476.  
  477. More new programs: Jay Sage, the author of ZCPR33, has developedáì
  478. áì
  479. ZFILER v.10f, a Z33-enhanced version of VFILER, our general dailyáì
  480. áì
  481. interface with the command processor, that allows for "groupáì
  482. áì
  483. macros."  Until now we were limited to running our scripts on aáì
  484. áì
  485. single pointer file. With ZFILER10F we have the capacity to run aáì
  486. áì
  487. macro script on all tagged files. This is a tremendousáì
  488. áì
  489. enhancement and opens up all sorts of possibilities. ZFILERáì
  490. áì
  491. scripts are 95% compatible with your VFILER.CMD scripts with oneáì
  492. áì
  493. major change: the '$' is used instead of '%' for the pointer fileáì
  494. áì
  495. parameters.áì
  496.  
  497.  
  498. Just to whet your appetite: suppose, for instance, you want toáì
  499. áì
  500. insert 6 different files on your disk into a single, alreadyáì
  501. áì
  502. existing library. You write an easy macro in your VFILER.CMD;áì
  503. áì
  504. let's call it "I" for "Insert":áì
  505.  
  506.  
  507. I nulu -O $"Name of library file ([DIR:]LIBNAME): " <<áì
  508. -a $f -x;era $fáì
  509.  
  510.  
  511. For those who haven't yet discovered V/ZFILER's [STARTáì
  512. áì
  513. BOLD]$"[END BOLD] symbol, it requests user input before anythingáì
  514. áì
  515. else runs in the script. It then inserts the user's response intoáì
  516. áì
  517. the final, expanded command line precisely at the locationáì
  518. áì
  519. between the $" and the terminating " (double-quote mark). Whenáì
  520. áì
  521. this script runs the very first thing that happens is that we areáì
  522. áì
  523. queried for the name of the LBR. We respond, hit <CR> and theáì
  524. áì
  525. pointer file, represented by '$f', is inserted into the LBR.áì
  526.  
  527.  
  528. As an example let's say we are pointing to LETTER.TXT and we wantáì
  529. áì
  530. to insert it inside CORRESPO.LBR. We hit our macro lead-in keyáì
  531. áì
  532. (default is <ESC>) and then "I."  The stringáì
  533.  
  534.  
  535.           Name of library ([DIR:]LIBNAME):áì
  536.  
  537.  
  538. appears on the screen. We answer "CORRESPO" and the followingáì
  539. áì
  540. command line is generated:áì
  541.  
  542.        áì
  543.  
  544.           NULU -O CORRESPO -A LETTER.TXT -X;ERA LETTER.TXTáì
  545.  
  546.  
  547. NULU can accept all this on its command line, so it worksáì
  548. áì
  549. beautifully.áì
  550.  
  551.  
  552. But, you ask, do you have to repeat the process six times foráì
  553. áì
  554. each of your files?  With VFILER you do; with ZFILER you don't.áì
  555. áì
  556. Simply tag all your files, run the new "group macro" command, hitáì
  557. áì
  558. "I" again, and stand back and watch while one by one six commandáì
  559. áì
  560. lines are generated and each file is inserted into CORRESPO.LBR.áì
  561.  
  562.  
  563. There's more: Jay, in his usual brilliance, has thought ofáì
  564. áì
  565. everything. The above technique is slowed considerably by timeáì
  566. áì
  567. spent loading and re-loading NULU six times from disk. For thoseáì
  568. áì
  569. wanting to experiment with the resident GO command here is youráì
  570. áì
  571. opportunity. By preceding a command script with the symbol '$!'áì
  572. áì
  573. GO is substituted for the command verb (here 'NULU') on every runáì
  574. áì
  575. but the first. GO of course runs whatever is in TPA memoryáì
  576. áì
  577. without having to pull it off the disk, so its speed isáì
  578. áì
  579. astonishing. The technique works flawlessly and is breathtakingáì
  580. áì
  581. to watch.áì
  582.  
  583.  
  584. The latest on the Z280 front: I've had considerable contact witháì
  585. áì
  586. Zedux, Inc., the southern California manufacturer of the genericáì
  587. áì
  588. Z280 add-on board that I mentioned last time. They do in factáì
  589. áì
  590. have a ready-to-run multi-tasking operating system called RPáì
  591. áì
  592. (Remote Partition) for their Accel 280, and I have arranged foráì
  593. áì
  594. them to come to San Francisco in mid-September to demonstrateáì
  595. áì
  596. their wares. They are urging attendees to bring whatever Z80áì
  597. áì
  598. computers they use, and they promise to walk around the room andáì
  599. áì
  600. plug a board into the different machines so as many folks asáì
  601. áì
  602. possible can get the experience of a multi-tasking operatingáì
  603. áì
  604. system running on their own computer. Promises to be quite aáì
  605. áì
  606. night.áì
  607.  
  608.  
  609. Hope y'all are having fun. Z you next time...áì
  610.  
  611.