home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / files / util / cli / quip / quip.doc < prev    next >
Encoding:
Text File  |  1993-08-31  |  60.7 KB  |  1,721 lines

  1. Document Quip, The Fortune Cookie Program From Hell
  2.  
  3.  
  4.             +-------------------------------+
  5.             |                |
  6.             |           Quip        |
  7.             |                |
  8.             |   The Fortune Cookie Program    |
  9.             |         From Hell        |
  10.             |                |
  11.             +===============================+
  12.             |  Joseph Edwards Van Riper III    |
  13.             +===============================+
  14.             |                |
  15.             |  A Cheese Olfactory Workshop    |
  16.             |        Production        |
  17.             |                |
  18.             +-------------------------------+                   
  19.  
  20.             
  21. 0. Legal Stuff
  22. ==============
  23.             
  24.             +-------------------------------+
  25.             |                |
  26.             |       LEGAL STUFF        |
  27.             |                |
  28.             +-------------------------------+                   
  29.  
  30. As is the way of man, sometimes, you just have to spell stuff out to
  31. people.
  32.  
  33. 0.1. Terms of Use
  34. -----------------
  35.  
  36. You are free to execute this program in any way you want.  You may put it
  37. on a disk and fire live rounds from your favorite rifle into it, lick the
  38. diskette you may have picked this up from.. heck, you can even use your
  39. favorite sector editor and write little <00>'s into it.
  40.  
  41. Of course, you may also use this for your BBS or your home system.
  42.  
  43. You owe me nothing except perhaps gratitude.. maybe not even that after
  44. you read some of the supplied quips.
  45.  
  46. Most people call this "Freeware", except I add on other special bonus to
  47. the whole thing... I have included the Source Code!  With THIS in mind,
  48. the program should probably be more properly called "Public Domain".  I
  49. only ask that you do not claim this work as your own, unless you modify it
  50. significantly, and even then, I ask that you include my name SOMEWHERE in
  51. the credits, by way of respect for the work that went into this frivolous
  52. project.
  53.  
  54. Otherwise, feel free to enjoy this program in any way that you feel you
  55. can find enjoyment.
  56.  
  57. 0.2. Distribution
  58. -----------------
  59.  
  60. If you dare to charge people anything more than what Fred Fish charges for
  61. a disk from his definitive PD/Shareware collection, you will be in
  62. violation of my right to have this product distributed freely to all
  63. peoples who wanted a product like this.  That is to say, You Should Be
  64. Ashamed Of Yourself, Where Is Your Mother To Discipline You?
  65.  
  66. If you are a user, and you happen to come across this work, and you've
  67. paid for it, you've been ripped off.  Please try to get in contact
  68. with some kind of authority in your respective country, to get your
  69. money back, and maybe eat the evil bastard for lunch.  At the very least,
  70. you should feel insulted that he thought so little of you as to allow this
  71. remark to remain in the documentation.
  72.  
  73. If you have written a very nice program.. perhaps a BBS or a database or
  74. something, and you wish to include my program with the distribution,
  75. regardless of ShareWare or Commercial fees, you are welcome to include
  76. this program in your distribution, as long as it is made clear that I
  77. (Joseph Van Riper) am the author of Quip.  I do not even require a copy of
  78. the registered version of the program be sent to me (although that would
  79. be exceptionally nice <grin>).  It should also be made clear that Quip is
  80. a Public Domain program, freely available, and that the user is paying
  81. only for your own product.
  82.  
  83. 0.3. Disclaimer
  84. ---------------
  85.  
  86. I, Joseph Edwards Van Riper III, and all peoples working for the Cheese
  87. Olfactory Workshop (in whatever guise), do hereby accept no responsibility
  88. for the results of this program.  Since you haven't paid for it, you
  89. accept full risks for what this program might do.  We will not be held
  90. responsible for anything lacking in the documentation, either... you, the
  91. user, are to accept the full risks of running this program.
  92.  
  93. While we've taken great pains to insure that nothing terribly serious
  94. could happen as a result of running this program, we cannot accept
  95. responsibility for this program's actions, or the documentation's wording
  96. which may lead you to whatever actions.  Enjoy this program, but don't try
  97. to pin anything on us <grin>.
  98.  
  99. So, if by some weird fluke, you read something in the documentation that
  100. suggests you try some parameter, and you find yourself in Alpha-Centari,
  101. sipping Methane in a plastic container, wearing naught but a joystick and
  102. several rubber skid-stops, we cannot be held responsible for it.  Find
  103. your own way home.
  104.  
  105. I strongly recommend, however, that the user read the instructions for the
  106. use of this program before running it, in order to minimalize any
  107. potential damage.  Please keep in mind, Quip modifies certain files under
  108. certain conditions that are easily predictable.  Quip also creates/deletes
  109. certain files according to another file/string's text... eg:
  110.  
  111. ".profile"
  112.  
  113. Might become:
  114.  
  115. ".profile.tab" (or) ".profile.0"
  116.  
  117. while
  118.  
  119. "RAM:garn.dat"
  120.  
  121. Could become:
  122.  
  123. "RAM:garn.0" (or) "RAM:garn.tab"
  124.  
  125. And
  126.  
  127. "RAM:blooie"
  128.  
  129. might become
  130.  
  131. "RAM:blooie.tab" (or) "RAM:blooie.0"
  132.  
  133. Also, all reported rumours about Quip stealing girlfriends away from men are
  134. completely without base.  Even more untrue is the unusual rumour that Quip
  135. will make you impotent, or will reduce your IQ by 5 points with each
  136. invocation.  The one about Quip making calls to the serial device is a total
  137. fabrication, and anything about Quip having Artificial Intelligence is
  138. truly overblown.
  139.  
  140. Read the docs.
  141.  
  142. 1. History Lessons
  143. ==================
  144.  
  145.             +-------------------------------+
  146.             |                |
  147.             |      History Lessons    |
  148.             |                |
  149.             +-------------------------------+
  150.             
  151. A Gilgamesh was the King of Uruk.. no, wait.. you can't be interested in THAT
  152. subject right now!
  153.  
  154. But you might be interested in `Quips History' or perhaps `COWs History'.
  155.  
  156. 1.1. Quips History
  157. ------------------
  158.             +-------------------------------+
  159.             |                |
  160.             |      Quip's History    |
  161.             |                |
  162.             +-------------------------------+
  163.  
  164. Quip has gone through a lot of changes over its time, and I didn't really
  165. keep a very good handle on all the various changes from version to
  166. version, but I can try to give somewhat of an idea, if you REALLY care
  167. about it.
  168.  
  169. 1.1.1. Quip One
  170. ---------------
  171.  
  172. Quip 0.01 (perhaps July 1991, Lattice C++)
  173.  
  174. The very first version of Quip was written because I wanted to see if I
  175. could program a fortune-like program for the Amiga (because I hadn't seen
  176. any up to that time).  I wanted to do it so one wouldn't have to have an
  177. extra table file hanging around the system.  Of course, this meant that
  178. the program would run rather slowly.  However, Quip 0.01 was SO incredibly
  179. slow because I hadn't figured out that Level 1 I/O meant non-buffered, and
  180. thus, I had to wait for disk-movement.  Boy was *I* an idiot!
  181.  
  182. 1.1.2. Quip Two
  183. ---------------
  184.  
  185. Quip 0.02
  186.  
  187. I had discovered that Level 2 I/O would speed things up considerably
  188. <grin>.
  189.  
  190. 1.1.3. Quip Three
  191. -----------------
  192.  
  193. Quip 0.03
  194.  
  195. I implemented the tablefile, as an option, because I was quite tired of
  196. how slow quip retrieval was.  It was pretty cool, suddenly seeing my
  197. little quips pop up almost instantly!
  198.  
  199. 1.1.4. Quip Four
  200. ----------------
  201.  
  202. Quip 0.04 (sometime in 1992)
  203.  
  204. I think I fixed some bugs in this version.  I can't remember what they
  205. were, though.  I DO remember that they were SO bothersome that I
  206. completely re-wrote the code, trying to take better advantage of C++'s
  207. object oriented features.  This also started the MS-DOS series of Quip
  208. programs, distributed almost exclusively in Charlotte, NC, and Minneapolis.
  209. Prefix and suffix files support started to appear in this version.
  210.  
  211. 1.1.5. Quip Five
  212. ----------------
  213.  
  214. Quip 0.05
  215.  
  216. More bug-fixes.  There were a couple of 'sub-versions' (like this wasn't
  217. already a sub-version) that were meant to fix minor problems (such as
  218. reading the filename from the arguments correctly in both Amiga and MS-DOS
  219. versions).
  220.  
  221. 1.1.6. Quip Six and Others
  222. --------------------------
  223.  
  224. Quip 0.06 (and incarnations)
  225.  
  226. Again, more bug-fixes, and some more features (better argument parsing, and
  227. all kinds of nifties).  Included with the archive for the Amiga version was
  228. a program that helped Citadel sysops convert archived messages into Quip
  229. datafiles in a nifty little format (handled anonymous messages, networked
  230. messages [although there was a stupid bug I put in it that will make it
  231. generate messages that look pretty dumb.. maybe I fixed this before I sent
  232. it out.. I dunno], time and date stamps, etc).  Pretty cool, really.  I
  233. also had assembled a rather huge datafile filled with over two thousand
  234. quips in it, and started distributing this file separately.  It was at this
  235. time people started complaining about how large the datafiles were, and
  236. could I PLEASE make them smaller somehow.  That's when I started working
  237. on.... (the next version of Quip).
  238.  
  239. 1.1.7. Quip Seven part One
  240. --------------------------
  241.  
  242. Quip 0.07 (June-July 1993, Amiga E compilor)
  243.  
  244. I had had enough of working with the Lattice C++ program.  I didn't have
  245. problems programming in C++, but I had problems with messing around with a
  246. stupid compilor.  I sorta copped an attitude against Lattice, 'cause I
  247. felt sorta funny about them charging for technical support when they give
  248. such a crummy manual.  I started looking for PD compilors, and stumbled
  249. into g++... which gobbled a full quarter of my humble hard-drive, so I
  250. dumped it in favor of Amiga E.  WOW!  Talk about a NICE compilor!  The
  251. docs are not the greatest, but functional enough for me to get around, and
  252. there was one major error in the docs that almost caused me fits when I
  253. first started working in E, but after a while I settled into it, and
  254. voila!  Quip!
  255.  
  256. This version of Quip was meant to be the last version I should have to mess
  257. with.  With that in mind, I gave it more features than the average person
  258. should have to mess with.  Unfortunately, MS-DOS support had to be dropped
  259. <giggle> since I programmed this in E, but the code size dropped
  260. dramatically, and the functionality of the program has increased beyond
  261. anything one could really have expected in such tiny code.  The source code
  262. is roughly 1,300 lines long, and could be tightened up if I bothered. I
  263. finally added icon support, and created the new `QuipScript' "language" for
  264. use by Quip.  I changed a few things in the CLI interface to make it more
  265. Amiga-like instead of unix-like.  It now uses ReadArgs, allowing me to
  266. avoid having to write a function to handle '?' and stuff like that.
  267.  
  268. 1.1.8. Quip Seven part Two
  269. --------------------------
  270.  
  271. Quip 0.07a
  272.  
  273. Oops.. so much for the version to end all versions.  I fixed the bug that
  274. caused all quips that were generated from a file not having a tablefile to
  275. have a '@' character preceding them... no longer has the '@' character.
  276. Super-easy fix... stupid oversight on my part (shoulda tested for this
  277. before sending it out.. to one person <grin>).
  278.  
  279. Fixed bug that caused it not to release its deathhold on various files
  280. when the user broke out of it (if invoked by icon).
  281.  
  282. Also fixed another silly bug that would make Quip exit with ridiculously
  283. high error codes, screwing up scripts.  Now exits properly (another easy
  284. fix).
  285.  
  286. Enabled randomized quips for datafiles without tablefiles (thanks to
  287. Lars Magnus Nordeide, who wrote WiseCrack, and gave away the source code
  288. in C.. cute algorythm.. I have no idea why I didn't see something so
  289. simple myself).  Also, using his idea of taking advantage of Nico's
  290. ReqTools library, I've added support for it in the form of the `REQ'
  291. tooltype/cli argument.  Oddly enough, this was a real bitch to do, since
  292. normally I don't bother to put all the quips in a single variable <sigh>.
  293.  
  294. 1.1.9. Quip Seven part Three
  295. ----------------------------
  296.  
  297. Quip 0.07b
  298.  
  299. Created `delay'able quips.  Now you can use the requesters, and not have
  300. to press 'Quip' to quit... after a specified amount of time, Quip
  301. will quit on its own.  Actually... after an obscene amount of time, Quip
  302. will quit on its own anyway (something like 90000 seconds).  Of course, if
  303. you specify the `NUM' keyword, it'll print NUM quips, one after the other,
  304. waiting the specified amount of time before quipping on.
  305.  
  306. 1.1.10. Quip Seven Part Four
  307. ----------------------------
  308.  
  309. Quip 0.07c
  310.  
  311. Added `UPDATE' feature, so tablefiles no longer have to be created from
  312. scratch.  Also fixed a bug that caused 40 bytes of memory to disappear each
  313. time Quip was run from CLI (stupid error.. I forgot to FreeDosObject() a
  314. pointer).  Quip is now a very CLEAN program <grin>.  Quip now actually does
  315. the `WHICH' command, and during roll-over, will not read the '0' quip (the
  316. information that comes between the quip-number and the first quip).  Within
  317. the scripting language, I created a new option called `RESET', which allows
  318. you to reset all the various options to their default values.  This means I
  319. changed the way I handled the setting/resetting of various values after
  320. `MAKE_QUIPS' and `IN_FILE', too.  I also included a new bug that uses the
  321. user's serial port to log into various nuclear weapons sites and fire
  322. warheads at the state of Georgia.  I'll leave it to you to figure out if I
  323. mean United State's Georgia, or the country of Georgia...
  324.  
  325. 1.1.11. Quip Seven part Five
  326. ----------------------------
  327.  
  328. Quip 0.07d
  329.  
  330. Quip now doesn't default when given bad arguments.. instead it'll give you
  331. some kind of idea why the arguments were bad.  In fact, all the error texts
  332. for Quip have been changed to be MUCH more informative.  Quip now tries to
  333. give you a reason why it couldn't do what you wanted <grin>.  Thank you,
  334. Commodore, for Fault()!  Also, you may now specify a file to send error
  335. messages, and anything else that isn't specifically a quip.  That is to say,
  336. using the `ERROR' command, you may redirect anything that isn't
  337. specifically a quip (or isn't a prefix/suffix/format text, or isn't a bad
  338. keyword in `QuipScript') to another file.  Could lead to dancing.
  339.  
  340. Yet another improvement.. Quip now looks for a default script (called
  341. 's:quip.script').  If it finds it, it'll `QuipScript' the script
  342. automatically, thus allowing you to handle a bunch of stuff by simply
  343. calling 'Quip'.  Also, QuipScript files no longer HAVE to put a #`IN_FILE'
  344. keyword in the script... QuipScript now defaults to "S:Quip.dat", just as
  345. the command-line/icon options do.  NOTE: if Quip finds an S:Quip.dat file
  346. to execute, it'll quit when the script is finished (just like any other
  347. script file).  I've also changed the code so you can specify a datafile to
  348. work with a particular script.. so if you invoke Quip with a `DATA'
  349. parameter, as well as a `SCRIPT' parameter, and the script doesn't set the
  350. datafile within it, the datafile you specify will be used instead.
  351.  
  352. I also changed the `FORMAT' command so that, if using a `REQ' or `DELAY'
  353. argument, the `FORMAT'ted string will appear in the menu bar, rather than in
  354. the text itself.  Something to keep in mind.
  355.  
  356. 1.1.12. Quip Seven part Six
  357. ---------------------------
  358.  
  359. Quip 0.07e
  360.  
  361. I fixed a few annoyances with the error-reports.  Quip now appends error
  362. messages with a date/time stamp heading the error-report.  `QuipScript'ing
  363. now sends #'s with non-commands (normally echoed to stdio while the script
  364. is running, always preceding any quips) in the order that it appears in
  365. the script.  Therefore, if you echo something to stdio, then generate
  366. quips, and echo something else to stdio, you'll see the text before, then
  367. after your quips, instead of always before.  You may also use a switch to
  368. toggle whether such messages are sent to stdio or to the error port.
  369.  
  370. A new `MIDDLE' option was created, to allow text to appear between quips when
  371. using the `NUM' option.
  372.  
  373. Prefix/suffix/middle/format options may now be direct text, or files
  374. specified in the command-line options/tooltypes (or in the QuipScript).
  375.  
  376. Prefix/Suffix/Format/Middle files/texts may now be whatever size you want
  377. (that the system can handle).  The only restriction is that the actual name
  378. of an environment variable may be no more than 80 characters long. 
  379. Environment variables may now hold text of any length.
  380.  
  381. You may now run a command using the filename env:quip.tmp as an argument
  382. from within Quip.  This is useful if you want to do things like, uh,
  383. run certain filter programs, or maybe use 'muchmore' to view your quips from
  384. an icon.  Beware, though.. some uglinesses abound (eg: 'type' doesn't work
  385. with Quip for some reason).
  386.  
  387. New `QuipScript' command `FINISHED' lets you end a script at that point. 
  388. Could be handy for certain goto statements.
  389.  
  390. 1.2. Cows History
  391. -----------------
  392.  
  393.             +-------------------------------+
  394.             |                |
  395.             |     The Cheese Olfactory    |
  396.             |        Workshop's        |
  397.             |         History        |
  398.             |                |
  399.             +-------------------------------+
  400.  
  401. It all started with the answering machine.  I had to figure out a new
  402. outgoing message, because the old one was stale (you know how it is).  In
  403. a sort of desperate attempt to come up with something, I said something
  404. like the following:
  405.  
  406. "Hello, and welcome to the Cheese Olfactory Workshop.  We have all kinds
  407. of cheese available for your nasal needs.  Our personal favorite is the
  408. limberger, which we've made especially potent with our new patented
  409. Cheese-Odorization formula.  Our manager, Mr. Van Riper, is unable to come
  410. to the phone right now, but if you leave your name and number, he'll be
  411. happy to inundate you with cheese later."
  412.  
  413. Actually, the original message was far stranger than even that, but I
  414. can't remember it.  I was just thinking about how funny such a name would
  415. sound.  Anyway, Piouhgd called, and became entranced with the name as
  416. well, so much so that he suggested I use it for all the programs I write.
  417.  
  418. Pioughd's girlfriend (now wife) has a certain affection for cows.  She has
  419. a cow-stool (for sitting), billions of cow magnets, cow seatcovers, cow
  420. utensils... I'm not entirely sure, but I think she even has a cow dress
  421. somewhere.  She refuses to eat cow products (milk and steak are OUT), and
  422. all the rest.  We, of course, got somewhat caught up in this, and started
  423. noticing weird things related to cows... eg. my ancestors came to the
  424. United States on a ship called The Spotted Cow.  Citadel BBS, our favorite
  425. BBS program, had a 'feature' where if you typed 'm' at a certain time you'd
  426. get a 'Moo...' out of it.  Funny stuff like that.  We, of course, noticed
  427. quite by accident that the Cheese Olfactory Workshop has COW for it's
  428. initials, and we went totally nuts over it.
  429.  
  430. There is a sort of Cheese Olfactory Workshop related `Pathos' that is
  431. always sort of developing, mostly related to my own hyperactive
  432. imagination, excuses as to why this-and-that program doesn't work right...
  433. perhaps you'll read about it if you are wasting your time reading this
  434. <grin>.
  435.  
  436. 1.2.1. Pathos
  437. -------------
  438.             +-------------------------------+
  439.             |                |
  440.             |    The Pathos Of COW    |
  441.             |                |
  442.             +-------------------------------+
  443.  
  444. Some of you may become angry at reading this useless tripe in the middle
  445. of a document file somewhere, but I figure it's just short enough and
  446. entertaining enough that perhaps you won't mind.
  447.  
  448. There are many reasons why COW takes so long to develop programs.  Mostly,
  449. the problems have to do with our slave programmers.  We've been trying to
  450. find more concientious slaves, but such things are always difficult to
  451. find.
  452.  
  453. Much earlier, we had a fairly good batch of slaves working for us, but one
  454. of them got uppity and started a rebellion.  In the process of trying to
  455. quell the rebellion, many of the slaves were killed.  It took us months to
  456. rebuild our stock of slave programmers, and we could only work the
  457. remaining ones so hard before their minds started to blow.
  458.  
  459. Then, a second rebellion occured, except it was much more subtle.  One of
  460. our slave programmers tried to write something into the code that would
  461. open up a dimensional portal to another place, allowing them to free
  462. themselves.  Unfortunately, they hadn't considered our specialized
  463. compilor trapping, and the portal opened up into a void, sucking fully
  464. half of our slaves into it.  We managed to close it before the rest were
  465. taken.  But, now we were left with so few programmers it was amazing we
  466. were able to get ANYTHING done.
  467.  
  468. Now, however, there has been a third rebellion, just before the writing of
  469. this latest version of Quip.  Someone tried to hack into one of the US
  470. Government's nuclear weapons' sites, and train a missile at one of our
  471. headquarters.  Unfortunately for them, they got the co-ordinates wrong,
  472. and bombed their own sites, meaning I had to program this puppy all by
  473. myself.  That's why it's taken over a year for Quip 0.07 to be written
  474. (sigh).  I'm still trying to get more slave programmers for COW, but good
  475. slave programmers are SO hard to find.
  476.  
  477. 2. CLI & WorkBench Usage
  478. ========================
  479.  
  480.             +-------------------------------+
  481.             |                |
  482.             |     CLI & Workbench Usage    |
  483.             |                |
  484.             +-------------------------------+
  485.  
  486. Quip has always offered CLI support, however, now Quip uses ReadArgs to
  487. handle the argument parsing.  This offers some extra flexibility, although
  488. users of the older versions of Quip will notice that the `FILES' parameter
  489. now only accepts one filename.  I apologize for this limitation, but it
  490. was easier to program this way, for the extra improvements added to the
  491. program.  If you REALLY want to process more files, try using the script
  492. language.  Or you could always import from Mars.
  493.  
  494. Now, Quip supports icon use.  If Quip doesn't have a need to print anything, 
  495. it will not open a window.  However, if it must print anything, Quip opens
  496. up it's own window to the WorkBench (or your own public screen if
  497. Shanghai'd) with a consoled clippable bit of text.  Provided there are no
  498. errors, the text will be your quip.  Regardless, to close the window, you
  499. need only press RETURN while the window is active.
  500.  
  501. The tooltypes you may use include all the various arguments used by the
  502. CLI, but you may not use any of the CLI's shortcuts.  Trust me.
  503.  
  504. 2.1. VERSION
  505. ------------
  506.  
  507.             +-------------------------------+
  508.             |                |
  509.             |          VERSION         |
  510.             |                |
  511.             +-------------------------------+
  512.  
  513. Just shows what version of Quip you're running (and displays a quip according
  514. to defaults).  The version is not the release version, but the program
  515. version.. something to keep in mind.  I'm not following StyleGuide
  516. conventions (totally) with regards to my selection of what version of Quip
  517. you're running.. my apologies.
  518.  
  519. 2.2. COL
  520. --------
  521.  
  522.             +-------------------------------+
  523.             |                |
  524.             |        COL         |
  525.             |                |
  526.             +-------------------------------+
  527.  
  528. This sets the column width of the file to be read as a script.  It
  529. defaults to 80 characters, however, if you need more for some reason, this
  530. option lets you have more.
  531.  
  532. 2.3. DATA
  533. ---------
  534.             +-------------------------------+
  535.             |                |
  536.             |           DATA         |
  537.             |                |
  538.             +-------------------------------+
  539.  
  540. This lets you specify which file you want to read a quip from.  It
  541. defaults to s:quip.dat.
  542.  
  543. 2.4. TABLE
  544. ----------
  545.  
  546.             +-------------------------------+
  547.             |                |
  548.             |          TABLE         |
  549.             |                |
  550.             +-------------------------------+
  551.  
  552. This tells quip that you want the file specified by `DATA' to have a new
  553. tablefile generated for it.
  554.  
  555. 2.5. FORMAT .com line.
  556. ----------------------
  557.             +-------------------------------+
  558.             |                |
  559.             |         FORMAT         |
  560.             |                |
  561.             +-------------------------------+
  562.  
  563. FORMAT takes a string holding text you want to appear between any `PRE'
  564. and the actual quip itself.  The usual `formatting' is done to the contents 
  565. of the FORMAT string.
  566.  
  567.  
  568. The string specified will appear in the menu bar of the quip if 
  569. `REQ .com line.' or `DELAY .com line.' was specified.
  570.  
  571. 2.6. FFORMAT
  572. ------------
  573.  
  574.             +-------------------------------+
  575.             |                |
  576.             |         FFORMAT         |
  577.             |                |
  578.             +-------------------------------+
  579.  
  580. This lets you specify a filename holding the text you want to see appear
  581. between the `PRE' and quip.  The text in the filename will be subject to
  582. `formatting'.
  583.  
  584. 2.7. PRE
  585. --------
  586.  
  587.             +-------------------------------+
  588.             |                |
  589.             |           PRE         |
  590.             |                |
  591.             +-------------------------------+
  592.  
  593. This specifies text that will come before the actual quip is written.  Subject
  594. to `formatting'.
  595.  
  596. 2.8. SUF
  597. --------
  598.  
  599.             +-------------------------------+
  600.             |                |
  601.             |           SUF         |
  602.             |                |
  603.             +-------------------------------+
  604.  
  605. This specifies text that will be appended to whatever quip is generated.
  606. Subject to `formatting'.
  607.  
  608. 2.9. MIDDLE .com line.
  609. ----------------------
  610.  
  611.             +-------------------------------+
  612.             |                |
  613.             |         MIDDLE         |
  614.             |                |
  615.             +-------------------------------+
  616.  
  617. This specifies text that will appear between quips on stdio.  Of course,
  618. this text won't appear if `NUM' isn't set to a value other than 1.  This is
  619. potentially useful for filtering programs that someone might design, or
  620. perhaps some kind of arcane purpose I haven't thought of.  And, as usual,
  621. the text undergoes `formatting'.
  622.  
  623. 2.10. FPRE
  624. ----------
  625.  
  626.             +-------------------------------+
  627.             |                |
  628.             |           FPRE         |
  629.             |                |
  630.             +-------------------------------+
  631.  
  632. Specifies a file holding text to prefix before a quip.  The text will
  633. undergo `formatting'.
  634.  
  635. 2.11. FSUF
  636. ----------
  637.  
  638.             +-------------------------------+
  639.             |                |
  640.             |           FSUF         |
  641.             |                |
  642.             +-------------------------------+
  643.  
  644. Specifies a file holding text to append to a quip.  The text will undergo
  645. `formatting'.
  646.  
  647. 2.12. FMIDDLE
  648. -------------
  649.  
  650.             +-------------------------------+
  651.             |                |
  652.             |         FMIDDLE         |
  653.             |                |
  654.             +-------------------------------+
  655.  
  656. This specifies a file holding text that will be treated as the 
  657. `MIDDLE (CLI/ICON' option.  Text undergoes `formatting'.
  658.  
  659. 2.13. WHICH
  660. -----------
  661.  
  662.             +-------------------------------+
  663.             |                |
  664.             |          WHICH         |
  665.             |                |
  666.             +-------------------------------+
  667.  
  668. This specifies a number which determines which quip will be generated (or
  669. from which quip a series of quips will be generated if the `NUM' argument is
  670. used).
  671.  
  672. 2.14. RANDOM .com line.
  673. -----------------------
  674.  
  675.             +-------------------------------+
  676.             |                |
  677.             |          RANDOM         |
  678.             |                |
  679.             +-------------------------------+
  680.  
  681. This is a switch telling Quip that you want your quips generated randomly.
  682. If your `DATA' file doesn't have an associated `TABLE' file, Quip can now
  683. generate random quips, but cannot tell you which quip it has picked up. 
  684. Therefore, if you use `FORMAT .com line.', and you use the {quip} variable,
  685. you will get a '0' instead of the expected result <grin>.
  686.  
  687. 2.15. DISPLAY .com line.
  688. ------------------------
  689.  
  690.             +-------------------------------+
  691.             |                |
  692.             |          DISPLAY         |
  693.             |                |
  694.             +-------------------------------+
  695.  
  696. This is a switch telling Quip that you want quips being generated by the
  697. `FILES' parameter to also be sent to stdio (or a window, for the Icon users)
  698. so you can see them.  Each quip will appear exactly as they appear in the
  699. file.
  700.  
  701. 2.16. NUM
  702. ---------
  703.  
  704.             +-------------------------------+
  705.             |                |
  706.             |           NUM         |
  707.             |                |
  708.             +-------------------------------+
  709.  
  710. This specifies how many quips you want to make with this invocation of
  711. Quip.  It defaults to 1 quip.  It's especially useful for Citadel sysops
  712. who want to create 60 quips for their BANNER, LONOTICE, NOTICE, or NOCHAT
  713. messages (when using the `FILES' parameter).
  714.  
  715. 2.17. FILES
  716. -----------
  717.  
  718.             +-------------------------------+
  719.             |                |
  720.             |          FILES         |
  721.             |                |
  722.             +-------------------------------+
  723.  
  724. This specifies a set of filesnames to create with quips in them (mostly
  725. useful for Citadel sysops).  The filename will have its name, plus a number
  726. appended to the end of it.  So, if you generate two quips (via `NUM'), and
  727. the filename you specify is 'BANNER', you get:
  728.  
  729. BANNER.0
  730. BANNER.1
  731.  
  732. Very useful for Citadel sysops.. perhaps less so for others.  Still, you
  733. can redirect stdio output if you really wanted to create only one quip
  734. with a specific filename (eg. Quip >myfilename.txt ).
  735.  
  736. 2.18. REQ .com line.
  737. --------------------
  738.  
  739.             +-------------------------------+
  740.             |                |
  741.             |           REQ         |
  742.             |                |
  743.             +-------------------------------+
  744.  
  745. This tells Quip that you want it to use Nico François' reqtools.library to
  746. produce a very nice looking quip on the screen.
  747.  
  748. 2.19. DELAY .com line.
  749. ----------------------
  750.  
  751.             +-------------------------------+
  752.             |                |
  753.             |          DELAY         |
  754.             |                |
  755.             +-------------------------------+
  756.  
  757. The number coming after this option tells Quip that you want to use Nico
  758. François' reqtools.library to produce a nice looking quip (as with the 
  759. `REQ .com line.' option), but you want it to get rid of the quip after that
  760. number of tens of seconds have passed.
  761.  
  762. Therefore, if you want the quip to be displayed for no more than 10
  763. seconds, you would use 'DELAY=100'.  Of course, the user can type a RETURN
  764. to get rid of the quip before the ten seconds are up.
  765.  
  766. 2.20. UPDATE .com line.
  767. -----------------------
  768.  
  769.             +-------------------------------+
  770.             |                |
  771.             |          UPDATE        |
  772.             |                |
  773.             +-------------------------------+
  774.  
  775. The number after this option tells Quip to update the tablefile from that
  776. number quip in the datafile you specify.  If you specify '0', it'll assume
  777. you mean the last known quip in the tablefile, and will add the new ones to
  778. the tablefile.  This command could save you a LOT of time in updating your
  779. tablefiles, or fixing skewed tablefiles.  I had wanted to put this in 
  780. `Quip Four', but found it hard to program.  I guess I had programmer's
  781. block at the time.  No.. wait, it was that one slave programmer...
  782.  
  783. 2.21. ERROR .com line.
  784. ----------------------
  785.  
  786.             +-------------------------------+
  787.             |                |
  788.             |           ERROR        |
  789.             |                |
  790.             +-------------------------------+
  791.  
  792. With this option, you specify what file you want error messages to be sent to.
  793. Sick users can use CON:, if they really want to (but the message will
  794. disappear as quickly as it was made, and it'll always create that CON:
  795. window.. really not a nice option).  Some might want to use NIL:.
  796.  
  797. 2.22. RUN .com line.
  798. --------------------
  799.  
  800.             +-------------------------------+
  801.             |                |
  802.             |           RUN         |
  803.             |                |
  804.             +-------------------------------+
  805.  
  806. This option will run a command, passing 'env:quip.tmp' (a file Quip will
  807. generate holding a quip in it) as an argument.  This can be useful for such
  808. things as 'quip run more' or the like.  Quip has no way of finding out the
  809. error code of the returned command, but it may tell you something via
  810. stdout.  If used from an icon, a window is created before running the
  811. command, and can be removed by tapping <RETURN> in the window.
  812.  
  813. EG: 'quip run more' will generate a quip, put the quip in 'env:quip.tmp',
  814. then execute a 'more env:quip.tmp' command.
  815.  
  816. This option is not too reliable, so always test it first.
  817.  
  818. 3. QuipScript
  819. =============
  820.  
  821.             +-------------------------------+
  822.             |                |
  823.             |      QuipScripting        |
  824.             |                |
  825.             +-------------------------------+
  826.  
  827. That's right, folks, Quip can read a script file in its very own language (a
  828. language much easier to master than BASIC, C, ARexx, or darn near anything
  829. else, because it doesn't have the greatest vocabulary in the world).  The
  830. first line in a script is ignored, so always start your scripts with some
  831. comment at the beginning.  Don't worry, you can put comments darn-near
  832. anywhere.. just be careful not to put them within lists, or on the same
  833. line as an option.  It would also be safer not to put comments on the same
  834. line as a keyword (although you can usually get away with it.. it's only
  835. dangerous if your comments happen to collide with any of the other
  836. keywords that exists.. eg: #IN_FILE  "I think a good PREFIX file..."
  837.  
  838. NOTE: Quip defaults to running a script called "S:Quip.script".  If it
  839. can't find this script, it'll run as normal.  If it CAN find it, it'll run
  840. that script.  If you specify a script with the SCRIPT option, it'll
  841. override the default script.  If you specify a script file called "NIL:",
  842. it will nullify the default script.
  843.  
  844. Therefore, if you have a file "S:Quip.script", but you want to run Quip
  845. without running any scripts (including the default script), try:
  846.  
  847. Quip script NIL:
  848.  
  849. (all caps on the 'NIL:').
  850.  
  851. Also, QuipScript files default to using "s:quip.dat" as the datafile, but
  852. if you specify a different datafile while invoking it, THAT datafile will
  853. be used instead... therefore "quip script boo.script data cookie.dat" will
  854. use the datafile 'cookie.dat' instead of 's:quip.dat', provided
  855. 'boo.script' doesn't have a #IN_FILE keyword used.
  856.  
  857. All keywords in QuipScript are in all caps, and start with a '#' character
  858. on the beginning of the line, as in:
  859.  
  860. #KEYWORD
  861.  
  862. Options for the keyword appear on the next line, are usually
  863. case-sensitive, and are preceded with a space:
  864.  
  865. #KEYWORD
  866.  option
  867.  
  868. All lines in QuipScript may only be 80 characters long, unless the `COL'
  869. command-line option is used to change it.  I cannot imagine why anyone
  870. would want to use more, but some people are strange <grin>.  If it's really
  871. a problem, try ASSIGNing to paths, or using environment variables.
  872.  
  873. Here is a listing of all the various keywords that exist in QuipScript:
  874.  
  875. 3.1. QuipScript Lists
  876. ---------------------
  877.  
  878. Lists are used when you want one selection chosen from a range of values. 
  879. They are terminated by a '#' character appearing at the beginning of a
  880. line (I generally put a '#END' at the end, but it's not looking for the
  881. work 'END', just the '#' character):
  882.  
  883. #KEYWORD_LIST
  884.  option1
  885.  option2
  886.  option3
  887. #END
  888.  
  889. There are only two keywords that indicate lists... `RND' and `SEQ'.
  890.  
  891. 3.1.1. RND
  892. ----------
  893.  
  894. If 'RND' appears with the keyword, and a list follows, the script will
  895. randomly select one of the options in the list:
  896.  
  897. #RND KEYWORD
  898.  option1
  899.  option2
  900.  option3
  901. #END
  902.  
  903. In the above example, option1, option2, or option3 will be selected
  904. randomly and used as a the option for 'KEYWORD'.  The only keywords that
  905. allow the use of the RND keyword with them are:
  906.  
  907. #RND `IN_FILE'
  908. #RND `OUT_FILE'
  909. #RND `FORMAT'  (also FILE_FORMAT)
  910. #RND `PREFIX'  (also FILE_PREFIX)
  911. #RND `SUFFIX'  (also FILE_SUFFIX)
  912. #RND `MIDDLE'  (also FILE_MIDDLE)
  913. #RND `SCRIPT'
  914. #RND `GOTO'
  915. #RND `CHANCE'
  916. #RND `ERROR'
  917. #RND `RUN'
  918.  
  919. 3.1.2. SEQ
  920. ----------
  921.  
  922. If 'SEQ' appears with the keyword, and a list follows, the script will
  923. sequentially select one of the options in the list:
  924.  
  925. #SEQ KEYWORD
  926. *option1
  927.  option2
  928.  option3
  929. #END
  930.  
  931. In the above example, option1 will be chosen, and the '*' will move so
  932. it's in front of option2.  The '*' character tells QuipScript which option
  933. to select.  If the '*' character is on the bottom option, it'll be set to
  934. the top option (from option3 to option1 in the above example).  If you
  935. fail to put the '*' in, QuipScript will put it on the top option, and will
  936. also select the top option for the keyword.
  937.  
  938. The following keywords can be used with the SEQ modifier:
  939.  
  940. #SEQ `IN_FILE'
  941. #SEQ `OUT_FILE'
  942. #SEQ `FORMAT'  (also FILE_FORMAT)
  943. #SEQ `PREFIX'  (also FILE_PREFIX)
  944. #SEQ `SUFFIX'  (also FILE_SUFFIX)
  945. #SEQ `MIDDLE'  (also FILE_MIDDLE)
  946. #SEQ `SCRIPT'
  947. #SEQ `GOTO'
  948. #SEQ `CHANCE'
  949. #SEQ `ERROR'
  950. #SEQ `RUN'
  951.  
  952. 3.2. IN_FILE
  953. ------------
  954.  
  955. IN_FILE tells QuipScript what Quip datafile you wish to grab quips from. 
  956. If you forget to specify this keyword, QuipScript will assume you want
  957. S:Quip.dat.
  958.  
  959. #IN_FILE
  960.  s:quip.dat
  961.  
  962. This tells QuipScript that 's:quip.dat' will be the file from which you'll
  963. grab quips.  A little redundant, but you can do this.
  964.  
  965. 3.3. OUT_FILE
  966. -------------
  967.  
  968. OUT_FILE tells QuipScript what file you want to write quips out to.  It's
  969. important to note, however, that this option is intended to work with
  970. Sysops running a Citadel BBS system (although others might find it
  971. useful).  The filename actually used is modified with an ending that has a
  972. number (the first is .0, then .1, .2, .3, and so on up to @{"HOWMANY" LINK "HOWMANY"} number 
  973. of quips you want to generate [minus one]):
  974.  
  975. #OUT_FILE
  976.  ram:banner.pre
  977.  
  978. This tells QuipScript to write quips to ram:banner.0, ram:banner.1, etc,
  979. until HOWMANY quips have been created.
  980.  
  981. 3.4. FORMAT
  982. -----------
  983.  
  984. FORMAT lets you sandwhich text between a `PREFIX' and the quip.  Note that the
  985. text entered here will undergo some `formatting' to certain conventions.
  986.  
  987. To specify a file from which to grab this text, use 'FILE_FORMAT'.
  988.  
  989. Note also that this string will appear in the menu bar of a quip if
  990. `REQ' or `DELAY' is specified.
  991.  
  992. EXAMPLES:
  993.  
  994. #FORMAT
  995.  Quip #{quip}:\n
  996.  
  997. Prints "Quip #2342:", and a new line, where the actual quip starts.  Well,
  998. the number depends on which quip was actually grabbed.
  999.  
  1000. #FILE_FORMAT
  1001.  s:quip.form
  1002.  
  1003. Looks in the file 's:quip.form' for the text to put between the PREFIX and quip.
  1004.  
  1005. #FORMAT
  1006.  {user}'s personal file #{quip}:\n
  1007.  
  1008. Prints "Joseph's personal file #234:" and a new line.  Assuming, of
  1009. course, that the environment variable 'USER' was set to 'Joseph', and that
  1010. the 234th quip was selected.
  1011.  
  1012. #FORMAT
  1013.  {date}:\n
  1014.  
  1015. Prints '2-Aug-93:' and a new line, assuming that you ran the command on
  1016. the 2nd of August, 1993.
  1017.  
  1018. 3.5. PREFIX
  1019. -----------
  1020. PREFIX specifies a filename that holds text that you want printed before
  1021. each generated quip.  This text will be printed before the `FORMAT' string,
  1022. too, which may be useful.  Note: the prefix will pass through the same
  1023. `formatting' as `FORMAT', but specifying {quip} will print '0'.
  1024.  
  1025. To specify a filename, use 'FILE_PREFIX'.
  1026.  
  1027. #PREFIX
  1028.  -------------------\n
  1029.  
  1030. The above text would appear just before the Quip, except '\n' would be changed
  1031. to a new-line character.
  1032.  
  1033. #FILE_PREFIX
  1034.  s:prefix.txt
  1035.  
  1036. specifies 's:prefix.txt' as a file holding text you want to prefix as above.
  1037.  
  1038. 3.6. SUFFIX
  1039. -----------
  1040.  
  1041. SUFFIX specifies a filename that holds text that you want printed after
  1042. each generated quip.  The same things regarding `PREFIX' apply to SUFFIX.
  1043.  
  1044. Don't forget about 'FILE_SUFFIX'.
  1045.  
  1046. #SUFFIX
  1047.  --------------------\n
  1048.  
  1049. The above text is appended to the quip, with an additional newline taking the
  1050. place of '\n'.
  1051.  
  1052. #FILE_SUFFIX
  1053.  s:suffix.txt
  1054.  
  1055. Whatever's in 's:suffix.txt' will be sent after the actual quip is sent.
  1056.  
  1057. 3.7. MIDDLE
  1058. -----------
  1059.             
  1060. MIDDLE lets you specify text to print to stdio between quips when `HOWMANY'
  1061. is specified.  It undergoes `formatting', and you can specify a filename by
  1062. using 'FILE_MIDDLE'.
  1063.  
  1064. #MIDDLE
  1065.  And now.. ANOTHER QUIP!\n
  1066.  
  1067. would print the above text between quips, replacing '\n' with a newline.
  1068.  
  1069. #FILE_MIDDLE
  1070.  s:middle
  1071.  
  1072. would look for the text to put between quips in the file 's:middle'.
  1073.  
  1074. 3.8. HOWMANY
  1075. ------------
  1076.  
  1077. HOWMANY lets you decide how many quips to generate at a time.  If sent to
  1078. stdio (the console), each quip will be separated by a newline.  If being
  1079. sent to files (the `OUT_FILE' keyword), HOWMANY files will be created,
  1080. starting from 0 to HOWMANY-1.
  1081.  
  1082. #HOWMANY
  1083.  60
  1084.  
  1085. This will create 60 quips.  If OUT_FILE is set to 'ram:banner.pre', 60
  1086. files starting at ram:banner.0 and ending with ram:banner.59 will be
  1087. created.  Great for Citadel sysops.
  1088.  
  1089. 3.9. RANDOM
  1090. -----------
  1091.  
  1092. RANDOM tells QuipScript that you want your quips to be chosen randomly. 
  1093. If you do not have a tablefile for the datafile you specified, RANDOM
  1094. cannot display which quip it has picked up, therefore the `FORMAT' command
  1095. should will display a '0' for the {quip} variable.  It's strongly
  1096. recommended you have previously used `MAKETABLE' to create a tablefile for
  1097. RANDOM, or the randomness will be severely effected (longer quips will be
  1098. less likely to be chosen, and the first quip is less likely to be chosen).
  1099.  
  1100. #RANDOM
  1101.  
  1102. No need for options.. this is a switch.  NOTE: use of this keyword will
  1103. cause QuipScript to look for a file called "env:rnd" for a random number
  1104. seed.  If it doesn't find the file, it'll create it, seeding the random
  1105. number generator with the clock.  If it DOES find it, it'll overwrite the
  1106. first four bytes with a random value that it'll use next time.  I've found
  1107. that this approach dramatically improves the generation of random numbers.
  1108. Future programs by myself will use this same approach to handling random
  1109. numbers (same filename, everything) in order to avoid dotting the
  1110. hard-drive (for floppy <yikes>) with billions of silly four-byte files.  I
  1111. ask that other programmers do the same thing.
  1112.  
  1113. 3.10. SERIAL
  1114. ------------
  1115.  
  1116. SERIAL cancels a `RANDOM' keyword.  It causes quips to be selected
  1117. sequentially from the datafiles (reading which quip it's supposed to grab
  1118. from the datafile itself, and writing the next quip value to search for 
  1119. after all the quips have been taken).  It is the default method by which
  1120. quips are selected.
  1121.  
  1122. #SERIAL
  1123.  
  1124. No need for options.. this is a switch.
  1125.  
  1126. 3.11. WHICHQUIP
  1127. ---------------
  1128.  
  1129. WHICHQUIP lets you decide which quip to start grabbing quips from.  If
  1130. used with `RANDOM', the first Quip will be WHICHQUIP, but subsequent
  1131. quips will be random.  This trick may be useful to avoid changing the next
  1132. quip value in the datafile (if all you want to do is read a particular
  1133. quip, but not change the sequential order in which you want to read that
  1134. quip).  If `SERIAL' is in use, quips will start from WHICHQUIP, and
  1135. continue until `HOWMANY' (or 1) quips are created, then the datafile will
  1136. point to HOWMANY+WHICHQUIP quip.  Confused yet?
  1137.  
  1138. #WHICHQUIP
  1139.  300
  1140.  
  1141. Find the 300th quip in the datafile and print it.
  1142.  
  1143. 3.12. MAKETABLE
  1144. ---------------
  1145.  
  1146. MAKETABLE tells QuipScript to make a tablefile for the datafile. 
  1147. Tablefiles let you have better randomized quips, and greatly speeds up the
  1148. time it takes to find quips.  If you edit a datafile, you'll probably have
  1149. to `UPDATE' a new tablefile, as you'll change where the quips are actually
  1150. located in the file <chuckle>.  Depending on how huge your datafiles are,
  1151. this keyword could take some time to be carried out... I wouldn't recommend
  1152. making a new tablefile each time you want a quip <grin>.
  1153.  
  1154. #MAKETABLE
  1155.  
  1156. No options.. this is a switch.
  1157.  
  1158. 3.13. DISPLAY
  1159. -------------
  1160.  
  1161. DISPLAY tells QuipScript to send the quips that are being generated to
  1162. `OUT_FILE' to stdio as well.  Normally, quips being sent to files are not
  1163. displayed in order to speed the process up.  However, if you want to see
  1164. them as they are being generated, this option is available.
  1165.  
  1166. #DISPLAY
  1167.  
  1168. No options.. this is a switch.
  1169.  
  1170. 3.14. MAKE_QUIPS
  1171. ----------------
  1172.  
  1173. MAKE_QUIPS actually starts writing all the quips.  It takes all the
  1174. information previously entered, and generates a quip from it.  This keyword
  1175. MUST be used, if you want any quips to be generated.  After using this
  1176. keyword, you may use other keywords to modify the settings, and use this
  1177. keyword again with the new modifications.  Only `RESET' actually changes all
  1178. the values to their defaults.
  1179.  
  1180. #MAKE_QUIPS
  1181.  
  1182. No options.. this is a switch.
  1183.  
  1184. 3.15. SCRIPT
  1185. ------------
  1186.  
  1187. SCRIPT will temporarily quit reading the current script, and start reading
  1188. the file you specify, resuming the old script when the SCRIPTed file is
  1189. finished.  You may nest as many of these as you want, although memory
  1190. becomes a consideration <grin>.
  1191.  
  1192. #SCRIPT
  1193.  option.1
  1194.  
  1195. The above will quit scripting there, reading 'option.1' for more quip
  1196. stuff, then resume after finishing 'option.1'.  Be careful about using
  1197. this keyword, as putting it in the wrong place in a script could have
  1198. peculiar effects.  Also, beware of creating a loop (a SCRIPT that calls
  1199. itself, or calls a script that will call the calling script).  SCRIPT does
  1200. NOT guard against this, to allow for more flexibility in script handling. 
  1201. Therefore, funky weirdnesses like:
  1202.  
  1203. #`RND' SCRIPT
  1204.  option.1
  1205.  samefilename
  1206.  samefilename
  1207.  samefilename
  1208. #END
  1209.  
  1210. where 'samefilename' is the name of the file you're currently scripting,
  1211. could create interesting havoc.  And:
  1212.  
  1213. #`SEQ' SCRIPT
  1214. *option.1
  1215.  samefilename
  1216.  samefilename
  1217.  samefilename
  1218. #END
  1219.  
  1220. would be ugly, indeed.  However, perhaps you might find a need for one of
  1221. these kinds of constructions.
  1222.  
  1223. 3.16. GOTO
  1224. ----------
  1225.  
  1226. GOTO will cause the script to continue at the LABEL specified.
  1227.  
  1228. #GOTO
  1229.  option
  1230.  
  1231. The script will continue execution from LABEL 'option'.  Read `LABEL' for
  1232. much more information.
  1233.  
  1234. 3.17. LABEL
  1235. -----------
  1236.  
  1237. LABEL doesn't really do much of anything, alone, but serves as a marking
  1238. place for a script.  The `GOTO' keyword will continue execution of the
  1239. script from the LABEL keyword, provided they have matching options.
  1240.  
  1241. #LABEL
  1242.  option
  1243.  
  1244. If a "#GOTO <linefeed, space> option" were issued somewhere, program
  1245. execution would continue from the above keyword.  EG:
  1246.  
  1247. #LABEL
  1248.  option
  1249. #KEYWORD1
  1250. #KEYWORD2
  1251. #KEYWORD3
  1252. #GOTO
  1253.  option
  1254.  
  1255. would allow KEYWORD1, KEYWORD2, & KEYWORD3 to be executed forever, since
  1256. the program would read them, get to the GOTO, leap up to the LABEL, and
  1257. continue doing the KEYWORD commands until something harder stops them
  1258. (like a truck, maybe).
  1259.  
  1260. It is advised to use the GOTO keyword with one of the List keywords, and
  1261. even then, with GREAT care.  Infinite loops are easy to create with the
  1262. GOTO keyword.
  1263.  
  1264. 3.18. CHANCE
  1265. ------------
  1266.  
  1267. CHANCE lets you randomly decide whether a certain command will be
  1268. executed, depending on the number given to it.  It will generate a random
  1269. number between 0 and 999, and if it's number is less than your number, the
  1270. following command will be executed.  I chose '1000' instead of '100' so
  1271. you could have more precision for your randomness.  Think of it as a
  1272. percentage with the decimal moved over one place (that is, 50 percent
  1273. chance of having something executed is 500, 75% is 750, 25.7% is 257,
  1274. etc).
  1275.  
  1276. #CHANCE
  1277.  230
  1278. #KEYWORD
  1279. (keyword options)
  1280.  
  1281. #KEYWORD has a 23% chance of being executed each time this script is run. 
  1282.  
  1283. NOTE: you may use the `RND' or `SEQ' list modifiers with your keyword with
  1284. this command.. CHANCE is smart enough to handle lists.  That is:
  1285.  
  1286. #CHANCE
  1287.  500
  1288. #RND KEYWORD
  1289.  option1
  1290.  option2
  1291.  option3
  1292. #END
  1293.  
  1294. would give a 50% chance of having any one of those options randomly chosen
  1295. for KEYWORD.  Pretty darned flexible, eh?
  1296.  
  1297. 3.19. REQ
  1298. ---------
  1299.  
  1300. REQ is a switch letting you print your quips to an information requester
  1301. from Nico François' 'reqtools.library'.  As long as the quip fits the
  1302. requester, it's a very beautiful way of looking at your quips, but you
  1303. cannot clip text from the requester <grin>.
  1304.  
  1305. #REQ
  1306.  
  1307. Tells QuipScript to show quips in a Requester.  No options.. this is a
  1308. switch.
  1309.  
  1310. 3.20. DELAY
  1311. -----------
  1312.  
  1313. DELAY lets you use a reqtools.library requester, as `REQ', but will only
  1314. leave the requester up for a certain amount of time, before taking it down
  1315. and moving on.
  1316.  
  1317. #DELAY
  1318.  50
  1319.  
  1320. Tells QuipScript to show the quips in a requester, but to take the
  1321. requester down after 5 seconds.
  1322.  
  1323. 3.21. UPDATE
  1324. ------------
  1325.  
  1326. UPDATE lets you update the tablefile for the datafile specified by `IN_FILE'.
  1327. If you use a '0' for an option, the update will occur from the last known
  1328. quip in the tablefile, adding the new quips in the datafile to the
  1329. tablefile, allowing you to use all the new quips you may have accumulated.
  1330.  
  1331. #UPDATE
  1332.  643
  1333.  
  1334. This will look for the 643rd quip, and start updating the tablefile from
  1335. that point in the tablefile, rather than starting at 0, as `MAKETABLE' does.
  1336. If there is no 643rd quip (maybe only 20 quips are in the file), it'll
  1337. default to the last known quip.
  1338.  
  1339. 3.22. RESET
  1340. -----------
  1341.  
  1342. RESET sets all the various settings to their defaults.  Normally, even
  1343. after a `MAKE_QUIPS' command, prefix files, suffix files, outputfile
  1344. name, random status.. everything remains intact for the next MAKE_QUIPS
  1345. command issued.  This allows you to reset everything to their original
  1346. default values:
  1347.  
  1348. #RESET
  1349.  
  1350. This is switch.. no parameters are taken.
  1351.  
  1352. 3.23. ERROR
  1353. -----------
  1354.  
  1355. ERROR causes all error messages (and other, perhaps undesirable stuff) to
  1356. be sent to the filename specified.  It defaults to a standard error port
  1357. (if called from CLI/Shell) or stdout (if called from icon).
  1358.  
  1359. #ERROR
  1360.  NIL:
  1361.  
  1362. This will send all error messages to nowhere.
  1363.  
  1364. #ERROR
  1365.  ram:boo.txt
  1366.  
  1367. This will put all the error messages in a file called "ram:boo.txt", if
  1368. any errors exist at all.
  1369.  
  1370. 3.24. OTHERECHO
  1371. ---------------
  1372.  
  1373. OTHER_ECHO is a toggle switch between sending '#' texts that have no keywords
  1374. to Standard I/O, or whatever is specified by `ERROR'.
  1375.  
  1376. Default is standard i/o.
  1377.  
  1378. #OTHER_ECHO
  1379.  
  1380. No parameters.. this is a toggle switch.
  1381.  
  1382. 3.25. RUN
  1383. ---------
  1384.  
  1385. RUN will run a command, passing 'env:quip.tmp' (a file Quip will
  1386. generate holding a quip in it) as an argument.  This can be useful for such
  1387. things as 'quip run more' or the like.  Quip has no way of finding out the
  1388. error code of the returned command, but it may tell you something via
  1389. stdout.  If used from an icon, a window is created before running the
  1390. command, and can be removed by tapping <RETURN> in the window.
  1391.  
  1392. #RUN
  1393.  more
  1394.  
  1395. Will generate the quip, put the quip in 'env:quip.tmp', then execute a 'more
  1396. env:quip.tmp' command.
  1397.  
  1398. 3.26. FINISHED
  1399. --------------
  1400.  
  1401. FINISHED causes the QuipScript to end at that exact point.  I figured it might
  1402. be a useful command when used with `GOTO' and `LABEL' commands.
  1403.  
  1404. #FINISHED
  1405.  
  1406. No options.. quits the script at that point.
  1407.  
  1408. 4. TECHNOTES
  1409. ============
  1410.  
  1411.             +-------------------------------+
  1412.             |                |
  1413.             |     Technical Notes    |
  1414.             |                |
  1415.             +-------------------------------+
  1416.  
  1417. For those of you out there who are curious, or want to consider some
  1418. advanced stuff to make Quip sing well for you.
  1419.  
  1420.  
  1421. 4.1. DATAFILES
  1422. --------------
  1423.  
  1424.             +-------------------------------+
  1425.             |                |
  1426.             |        DATAFILES        |
  1427.             |                |
  1428.             +-------------------------------+
  1429.  
  1430. If you wish to create your own datafiles, please keep a few things in
  1431. mind.
  1432.  
  1433. Datafiles start with about 15 or 12 characters designated for holding a
  1434. number.  This number is used by Quip to figure out which quip it's
  1435. supposed to pick next.  I chose to do this as an ASCII number rather than
  1436. a binary number so you can change it manually if you want.  But, if you
  1437. don't give these 15 or so characters to Quip, it'll just gobble them up
  1438. anyway, trampling on top of whatever information you might have had there
  1439. in the first place.
  1440.  
  1441. After these characters, however, you can put anything you want in the
  1442. datafile, but remember that all quips are delimited by '@' characters
  1443. (something I'm thinking about changing in the future.. maybe to formfeed
  1444. characters).  Therefore, the actual quips themselves start the moment you
  1445. put the first @ character in the file.
  1446.  
  1447. You may wish to consider writing scripts in this space: `QuipScript' quits
  1448. when it sees the '@' character.  But I wouldn't recommend writing anything
  1449. big, because when Quip 'rolls over' (during sequential quips, if the next
  1450. quip is larger than the number of quips available, Quip will go back to
  1451. the first quip again), it'll have to read through all that information to
  1452. find the first '@' character.
  1453.  
  1454. As you may have figured out already, each new quip is supposed to start
  1455. with a '@' character.  Otherwise, you may have whatever set of characters,
  1456. in whatever combination you want, as you desire, with the exception of the
  1457. 'NULL' character (ASCII 0).  The NULL character will truncate your quip! 
  1458. I would have used it to delimit quips, except most people have a difficult
  1459. time putting them in with a simple text editor <grin>.
  1460.  
  1461. Also, keep in mind that datafiles with tablefiles need to have a new
  1462. tablefile create every time the datafile is edited.  If you don't, your
  1463. quips may be askewed, or ignored altogether.  So, if you add new quips to
  1464. a datafile, be sure to create a new tablefile for it.
  1465.  
  1466. Beware the write-protection bit... make sure that it is not set on
  1467. ANYTHING having to do with Quip.  I'm not sure if it's due to a bug in the
  1468. OS, or if it's because my hard-drive uses OFS instead of FFS (I've been
  1469. having trouble converting it over to the other format for some stupid
  1470. reason), but Quip hasn't been able to handle write-protection errors
  1471. properly... it thinks everything is fine!
  1472.  
  1473. Therefore, tablefiles can ge utterly destroyed by Quip if they are
  1474. write-protected, and datafiles will not be updated if write-protected
  1475. (during any options that call for Quip to write to the file, as in
  1476. `UPDATE' and `TABLE' commands).
  1477.  
  1478. 4.2. SCRIPTFILES
  1479. ----------------
  1480.  
  1481.             +-------------------------------+
  1482.             |                |
  1483.             |       SCRIPTFILES        |
  1484.             |                |
  1485.             +-------------------------------+
  1486.  
  1487. When making scriptfiles, your comments may appear pretty well anywhere you
  1488. want, except on the same lines as a parameter.  Be careful, however, about
  1489. writing comments in ALL CAPS.  You stand a chance of writing a command by
  1490. accident.
  1491.  
  1492. You may have noticed that lines that are preceded with a '#', but don't
  1493. have a proper command after them, are printed to stdio (or to a window, if
  1494. invoked from an Icon).  This can be used to help trace where your scripts
  1495. are, or perhaps as a kind of extra 'prefix/suffix' "feature".  The '#'
  1496. itself is not displayed.
  1497.  
  1498. Be careful when creating your scriptfiles.  `QuipScript' really isn't
  1499. intended as a full-blown language, so it doesn't do any kind of checking
  1500. to speak of.  If you fail to end a `RND' or `SEQ' list with a '#' line, weird
  1501. things can happen in your scripts.  THIS IS EASY TO FORGET!  While testing
  1502. this, I've forgotten the thing myself many times.  There is really no way
  1503. I can test for it AND keep the flexibility, so I'll simply assume that
  1504. good programmers will read the directions <grinning stupidly, in full
  1505. knowlege that I don't read the directions either>.
  1506.  
  1507. Also, there are times when the '@' character is not looked for!  While
  1508. processing lists (!), and during #CHANCE command handling, and while
  1509. searching for a matching #`LABEL' from #`GOTO' (!), the '@' is not looked for,
  1510. so you can use that character within your scripts as part of the options.
  1511. BE CAREFUL... if you decide to write a script within a `datafile', make sure
  1512. your script is working PERFECTLY before actually committing to it, or you
  1513. could wind up with a script that hunts through all 10 megs of data before
  1514. coming to the realization that something is quite wrong <grin>.
  1515.  
  1516. You can do some nifty tricks with QuipScript, if you're clever (and you
  1517. have the inclination).  You can set up a label at the end of the file
  1518. (say, #LABEL<newline> END), then set up a #`CHANCE' statement, followed by a
  1519. #GOTO<newline> END statement, to create a percentage chance of the script
  1520. being quit!  You can also set up crude 'for/next' loops using SEQ
  1521. statements looped with GOTO statements.  Play around with QuipScripting..
  1522. you can always press Control-C to get out of Quip at any time.
  1523.  
  1524. 4.3. Random Number Generator
  1525. ----------------------------
  1526.             
  1527.             +-------------------------------+
  1528.             |                |
  1529.             |   Random Number Generation    |
  1530.             |                |
  1531.             +-------------------------------+
  1532.  
  1533. Quip runs a nifty little routine prior to doing anything.  This routine
  1534. looks for a file called 'rnd' in the ENV: directory.  If it doesn't find the
  1535. file, it'll go into the system clock (through proper DOS channels).  The
  1536. value it's looking for will be a seed for the program to use for
  1537. generating random numbers.  When it gets the seed, it then creates a new
  1538. one, putting it in ENV:rnd.
  1539.  
  1540. The idea is to avoid having billions of different little files running
  1541. around with four-byte values used to seed the random number generator,
  1542. while still giving you really good random numbers.  The reason why using
  1543. the clock is out (at least, to me), is because even over a period of an
  1544. hour, the numbers are not very random.  Since Quip is a short-running
  1545. program, calling it each time and borrowing the seed from the clock
  1546. doesn't really yeild a very random number.. especially if you're running a
  1547. BBS and you're calling it each time a user logs in.  The reason I use the
  1548. ENV: directory instead of tracking quip's own directory is because I figure
  1549. one centralized place for the random number file, useable by other
  1550. programs (maybe even by libraries in the future) is A Good Thing. 
  1551. Especially since I intend to use this routine in other programs that
  1552. require random numbers.
  1553.  
  1554. There are, of course, drawbacks.  Firstly, it's just that little bit more
  1555. time having to go through the filesystem to find a seed.  Although I only
  1556. have to do it once, it might be considered annoying.  Secondly, to quote
  1557. Ulrich Kaufman (author of the XEM standard): "It is against the philosophy
  1558. of ENV: to use binary data."  Text would be nicer, but it's easier to work
  1559. with four bytes than twelve.  Also, unless you run another little program
  1560. that creates a value in an ENVARC:rnd file every time you boot up, you
  1561. stand a chance of either having the same random numbers popping up (in the
  1562. case of an ENVARC:rnd file existing and being written to ENV: each time it
  1563. boots, without being change itself), or the system will always have to
  1564. rely on the clock for the first generated random number.  Not TOO bad, but
  1565. I could hope for better <grin>.
  1566.  
  1567. All-in-all, though, I think this method works best.  Just be aware, you'll
  1568. be four-bytes poorer in your ENV: directory after running Quip <grin>.
  1569.  
  1570. 4.4. Requester Library
  1571. ----------------------
  1572.  
  1573.             +-------------------------------+
  1574.             |                |
  1575.             |   Requester Library Support    |
  1576.             |                |
  1577.             +-------------------------------+
  1578.  
  1579. Quip now takes advantage of Nico François' reqtools.library.  Please keep
  1580. in mind that the reqtools.library's Copyright (c) is owned by Nico
  1581. François, who has graciously allowed the rest of us lazy people to write
  1582. nice programs using this bit of software.
  1583.  
  1584. Inasmuch as it's wonderful, you should probably try to keep quips that go
  1585. into the requester somewhat within the requester's size limitations. 
  1586. Quips that are larger than 78 columns (I think) tend to be a little
  1587. troublesome, and those with billions of lines probably won't look very
  1588. good, either.  Otherwise, it's a very nice, pretty way of looking at your
  1589. quips.
  1590.  
  1591. Another minor note: as much as I would like to avoid busy-waiting, to some
  1592. extent this program has to busy-wait through a DELAYed requester, in order
  1593. to tell when the time is up, or when the requester is done.  Fortunately,
  1594. however, I am using a Delay(5) in there, so it'll only check every 10th of
  1595. a second for a value.  So.. while it IS busy-waiting, it's a kind of
  1596. low-impendence busy-wait, so it shouldn't be as bad.  I could have made
  1597. the value larger (Delay(50)), but 10th/seconds are a good round measure,
  1598. fast enough to keep someone from waiting for the program to finish, but
  1599. slow enough to keep resources from going nuts in the multi-tasking.
  1600.  
  1601. Also, keep in mind that a `REQ' requester is really a `DELAY'ed requester that
  1602. takes 90000 seconds to finish.  Therefore, it suffers from the same
  1603. busy-wait problem.  I did this to save a little extra room in the
  1604. programming.  My apologies if this is ugly.
  1605.  
  1606. 5. CREDITS
  1607. ==========
  1608.  
  1609.             +-------------------------------+
  1610.             |                |
  1611.             |          Credits        |
  1612.             |                |
  1613.             +-------------------------------+
  1614.  
  1615. Although I, JEVR3, did all the programming, I couldn't have done everything
  1616. without the help of some very special guin.. er, people, who beta-tested
  1617. this version of Quip for me (perhaps uncovering stuff I missed).  Some of
  1618. these guys were also a great source of moral-strength <grin>.  I consider
  1619. them a part of the Cheese Olfactory Workshop, for their efforts...
  1620.  
  1621. Kevin Thomas        - Death Colas, MS-DOS help (in earlier
  1622.               versions), The Static Quip, and various ideas.
  1623.  
  1624. Gay Crumley        - Helped out with LD calls in the US, letting me
  1625.               set up the COW room for discussing Quip and other
  1626.               assorted things (It's a Citadel Thing).
  1627.  
  1628. Lars Magnus Nordeide    - Author of WiseCrack, a program that sorta does
  1629.               what Quip does (although, not with the same
  1630.               amount of steroids).  I took a couple of his
  1631.               ideas and put them in Quip, although my code
  1632.               itself is certainly mine (nothing beyond an 
  1633.               idea was copyed from Mr. Nordeide).
  1634.  
  1635. Stephan Sürken        - Author of Text2Guide, which was used to help
  1636.               make these documents (only AFTER I had already
  1637.               made the AmigaGuide-style by hand <sigh>).
  1638.               Any funkyness you see in this document is there
  1639.               in order to accomodate some of Text2Guide's fancies,
  1640.               and to help accomodate AmigaGuide's funkyness.
  1641.               One of these days, I really should send Mr. Sürken
  1642.               some suggestions for the program (if he cares).
  1643.  
  1644. rlang@firebird.newcastle.edu.au
  1645.             - One of the beta-testers for Quip 0.07.
  1646.  
  1647. bhogsett@bix.com    - Found a bug I would never have found in my
  1648.               Quip.guide documentation.  Also one of the
  1649.               beta-testers for Quip 0.07.
  1650.  
  1651. ralle@oberon.dinoco.de    - One of the beta-testers for Quip 0.07.
  1652.  
  1653. 6. FORMATTING
  1654. =============
  1655.  
  1656. Prefix, Suffix, Middle, and Format texts/files are run through a
  1657. formatting field that may change certain things around, allowing a measure
  1658. of flexibility that might be useful.
  1659.  
  1660. The following characters in the format strings insert the following
  1661. things:
  1662.  
  1663. {day}  = Day of week, as "Monday" or "Tuesday"
  1664. {date} = Date, in dd-mmm-yy format (AmigaDos format)
  1665. {idate}= International date, yy-mm-dd
  1666. {adate}= American date, mm-dd-yy
  1667. {cdate}= Canadian date, dd-mm-yy
  1668. {time} = Time, in hh:mm:ss format (sorry, only 24 hour format)
  1669. {quip} = The number of the quip that was generated (only works with
  1670.          FORMAT/FILE_FORMAT commands, otherwise yeilds '0')
  1671. {[any]}= Text from whatever environment variable you specify.
  1672.          Great for {user}, {system}, and so on.  Looks at local
  1673.      environment variables first, then global ones.  NOTE: make sure you
  1674.      set the variable with Commodore's SET or SETENV rather than, say,
  1675.      csh's 'set' command, as QuipScript is using AmigaDos calls to find
  1676.      this value.
  1677. {{}    = { character
  1678.  
  1679. %%     = % character.. a quirk of using RawDoFormat()
  1680.  
  1681. \n     = New line
  1682. \r     = Return (same line)
  1683. \t     = Tab character
  1684. \f     = Formfeed (clear screen)
  1685. \g     = Bell characer (ASCII 7)
  1686. \e     = ESC (ASCII 27)
  1687. \\     = backlash
  1688.  
  1689. Other '\' values will be weeded out.  Environment variables not set will
  1690. be ignored.  Be careful not to use RawDoFormat characters while making
  1691. prompts (eg. %s, %ld, %c, etc).  RawDoFormat is used to generate the number
  1692. of the quip that is being generated (parameter {quip}).  Therefore, if you
  1693. enter a RawDoFormat character sequence, you may create bizarre,
  1694. unpredictable formats for your quips.  Use the double % to produce a %.
  1695.  
  1696. I apologize for not providing for binary values, however if you have a
  1697. really nice editor, binary values inserted in the line will not be filtered
  1698. <grin>.
  1699.  
  1700. EXAMPLES:
  1701.  
  1702.  Quip #{quip}:\n
  1703.  
  1704. Prints "Quip #2342:", and a new line, where the actual quip starts.  Well,
  1705. the number depends on which quip was actually grabbed.  Of course, if this
  1706. string is being used with anything other than FORMAT, you get "Quip #0:"
  1707. and a new line.
  1708.  
  1709.  {user}'s personal file #{quip}:\n
  1710.  
  1711. Prints "Joseph's personal file #234:" and a new line.  Assuming, of
  1712. course, that the environment variable 'USER' was set to 'Joseph', and that
  1713. the 234th quip was selected, and it's being used in the FORMAT command
  1714. (otherwise, it'll say "Joseph's personal file #0:" and a new line).
  1715.  
  1716.  {date}:\n
  1717.  
  1718. Prints '2-Aug-93:' and a new line, assuming that you ran the command on
  1719. the 2nd of August, 1993.
  1720.  
  1721.