home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / comms / bbs / bullchk1.lha / BullCheck.txt < prev    next >
Text File  |  1992-03-30  |  10KB  |  277 lines

  1. Bulletin Check, by Todd Courtnage
  2.  
  3. Version 1.0
  4.  
  5.  
  6.  
  7.  
  8.  
  9. YAAAAAAAAAAA!!!!!!!!!!!!!!!
  10.  
  11. My first ARexx program!!!!!!!!!!!
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19. This is an ARexx procedure, meant to be put in your logon.trans.
  20.  
  21. What it does is check all the bulletins and see if any of them have
  22. been updated since the users last call.  If so, it will tell the user
  23. which ones have been updated, and ask the user to read them, because
  24. they may contain very important, life and death material (not likely
  25. tho :-).
  26.  
  27.  
  28.  
  29. First off, since this is my first ARexx program EVER, it's very poorly
  30. written (but, hey, it gets the job done!  (for me anyway)).  The way
  31. it goes about getting the dates of the bulletin files is very, very
  32. crude, and could be (and will be!) optimized to make it MUCH, MUCH
  33. better at what it does.  If you want to learn ARexx, DON'T LOOK AT MY
  34. PROGRAM!!!!!!!  My baby here is probably the worst code ever written
  35. for any computer!!!
  36.  
  37.  
  38.  
  39. If you want some more info as to what the program is trying to do, see
  40. the "The Guts of the Program and Other Horror Stories" later in this
  41. document.  It has a small story to tell too :-).
  42.  
  43.  
  44.  
  45. As for using it, well I figure if your smart enuff to own ARexx, your
  46. smart enuff to know how to make it work :-).  Actually, there is some
  47. work involved in getting it set up to work with your system (unless
  48. you have the exact same setup as me, which is very unlikely).
  49.  
  50.  
  51.  
  52. First off, change the "bulletindir" variable to show the file path to
  53. where your bulletin directory is.
  54.  
  55.  
  56.  
  57. Second, on the line immediately below where you specify your path,
  58. enter the number of bulletins that you want to be checked to see if they
  59. have changed since the user logged on last.
  60.  
  61.  
  62. Thirdly, you have specify all the filenames of the bulletins you want
  63. checked.  Don't include the path, because you entered the path earlier.
  64.  
  65. Note that you will probably have to adjust the number of "bull.#"
  66. lines to suit your setup (i.e. if you only have 9 bulletins, you will
  67. only have nine bull.# lines listed in the program).
  68.  
  69. For Example if you have nine bulletins, the lines in the program will
  70. look like this:
  71.  
  72.         bull.1 = "filename1"
  73.  
  74.         bull.2 = "filename2"
  75.  
  76.         .
  77.  
  78.         .
  79.  
  80.         .
  81.  
  82.         bull.9 = "filename9"
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90. Fourthly, (and lastly I think) you have to enter the names of the
  91. bulletins (these should probably be the way they are listed in your
  92. bulletins.cmds file.)  The number of bulletins named here should be equal
  93. to the number you had above where you entered the actual filenames.
  94.  
  95.  
  96.  
  97. That should be just about it, except you have to copy the procedure to
  98. your logon.trans file and make a call to the procedure somewhere in
  99. your logon.trans (I do it at the end).
  100.  
  101.  
  102.  
  103. Limitations
  104.  
  105.         There are limitations to this program.  First of all, the dates
  106. of your bulletin files should be sometime on or after Jan. 1, 1992
  107. (for the reason for this, see "The Guts of the program and other
  108. Horror Stories").  Also, this procedure will not be any good after
  109. this year.  That's not a big problem, because I plan on doing a better
  110. version within the next 8 months :-).
  111.  
  112.  
  113.  
  114. What's in the Future
  115. ~~~~~~~~~~~~~~~~~~~~
  116.  
  117.  
  118.         Well, first of all, clean it up A LOT!!!!!  By this I mean,
  119. reading in the bulletins from the bulletins.cfg file (as well as the
  120. number of bulletins).  Also read in the names of the bulletins from
  121. the bulletins.cmds file.
  122.  
  123.         Find a better way to do calculations (like figure out a better
  124. way to get the date of a file besides the way I'm doing it right now).
  125.  
  126.         Option for the user to read the bulletins right then and there.
  127.  
  128.         Maybe some ANSI support.
  129.  
  130.         Any other suggestions, bug fixes (which there are bound to be
  131. lots).
  132.  
  133.  
  134.  
  135. The Guts of the Program and Other Horror Stories
  136. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  137.  
  138.  
  139.         As I've mentioned before this is a program from hell.  I had
  140. virtually no idea what I was doing when I was writing this.  The code
  141. is appalling, ghastly, horrendous, and any other awful words you can
  142. think of.
  143.  
  144.         If you've looked at the code already, you probably don't
  145. understand any of it.  Well, here's the story of how I got from no
  146. code to what the code you have in front of you now.
  147.  
  148.         I got the idea for this from other BBS programs that notify the
  149. user when a new bulletin has been added or changed.  So I figure it
  150. wouldn't be hard to write an ARexx program to do the same with
  151. TransAmiga (and I hadn't seen any around).  So I start thinking about
  152. it in my head.  I figure no problem.  Well, first I figure I gotta
  153. find out how to get the file creation date of each of the bulletin
  154. files.  No big deal, I thought.  I start looking for a command in the
  155. ARexx manual to do that, and do you think I could find one???????  No
  156. way!!!!  The closest command I could find was STATEF(), but according
  157. to the ARexx manual that only returns a files length, blocks,
  158. protection and comment.  I thought it was over right then and there.
  159. I had thoughts of maybe having a text file where you'd have to type in
  160. the dates of all the bulletin files, and whenever you changed a
  161. bulletin, you'd have to change the corresponding line in this text
  162. file so Bulletin Check (the name of my program) would know of the
  163. change.
  164.  
  165.         Well, this wasn't acceptable.  So later that evening, I was
  166. browsing thru the Feb. 1992 issue of .info.  I happened across the
  167. ARexx column, and started looking at it, and after looking it over I
  168. realized all my problems were solved!!!!  This issue just happened to
  169. explain how to get the file date from a file!
  170.  
  171.         A-ha!!  All my problems are solved ............. NOT!!!!!!
  172.  
  173.         Well, I did what they were doing in there column to check the
  174. dates of files and see if the files were newer or older.  (In fact the
  175. column compared the two files and decided if one was newer, it would
  176. copy it over to another directory.  It was an updating file copier
  177. written in ARexx.)  Well, I was following there instructions, for
  178. using the STATEF() function, but was getting weird values when it came
  179. to the date.  I kept getting high numbers like 5177 and 5263 and I
  180. couldn't find ANY relationship between the dates and these numbers.  I
  181. spend literally HOURS trying to figure out what (I thought) I was
  182. doing wrong.  I made little changes here and there, and still wasn't
  183. getting what I was "supposed" to be getting (naturally, to make life
  184. even harder I kept making little mistakes that would make the program
  185. not function at all and that ate up even more hours of debugging).
  186.  
  187.         Anyway, after hours and hours, I FINALLY found somewhat of a
  188. relationship between the numbers I was getting.  If I took one of the
  189. large numbers from one file (say 5177), and subtracted from that
  190. another large number (like 5123), the result was the number of days
  191. between the dates of the files.  Well, further investigation revealed
  192. that if I took the numbers and converted them to years, that these
  193. numbers showed the number of days between some date in 1978 (there's
  194. something magical about 1978 and the Amiga, but I'm still not sure
  195. what) and the date of the file (when the file was last changed).
  196.  
  197.         So hence, maybe know you can start to understand where all those
  198. weird numbers in the code are coming from.  I ended up having to take
  199. some arbitrary date (I used Dec. 31, 1991), and from there calculate
  200. the number of days from that date to when the files were changed.  So,
  201. from that I had to calculate which month it was and which day of the
  202. month it was (and also assumed that the year of the file was 1992).
  203. (You have to remember thru all this, I'm still very much a novice at
  204. ARexx.  Some of you out there in TA land could probably whip up
  205. something like this in less than half the time it took me).
  206.  
  207.         Well, anyway, that's most of the story.  Once I had the month and
  208. day of the file, it was relatively easy going (compared to the hell of
  209. figuring out the file stuff).  In fact, most of the program is about
  210. the file dates, and trying to figure them out!
  211.  
  212.         Hmmm, not much else to tell about the program from hell.
  213.  
  214.  
  215.  
  216. Legalities
  217. ~~~~~~~~~~
  218. I take no responsibility for anything (except if it's something good
  219. :-)
  220.  
  221.  
  222.  
  223. Other Stuff
  224. ~~~~~~~~~~~
  225.         I really want comments and suggestions on this (especially if you
  226. know how to get the REAL date of a file!!!)  Anything else you want to
  227. see added?  I can be contacted via the following means:
  228.  
  229.  
  230.  
  231. The ABYSS - (306)586-7279     - This is my BBS
  232.  
  233. MEBBS][ BBS - (306)775-1437     - The official Canadian support BBS for
  234.                                                   TransAmiga.  I call here almost
  235.                                                   everyday, so I can be reached here.
  236.  
  237. Internet:  My Internet address is courttod@max.cc.uregina.ca
  238.  
  239. TransAmiga echo:  I'm always reading the TA echo, so you can send me
  240.                            mail thru here if you want to give suggestions or
  241.                            bug reports.
  242.  
  243. Netmail: Todd Courtnage at 1:140/140
  244.  
  245. CompuServe:  not suggested, as I hardly ever go on here (it costs a
  246.                    fortune to call from Canada).  But if you REALLY want to
  247.  
  248.                    my usernumber is 71621,414.  There is no guarantee I'll
  249.                   get your message this way tho.
  250.  
  251.  
  252.  
  253. Updates
  254. ~~~~~~~
  255.         I will post updates at two locations.  On MEBBS ][, the official
  256. TransAmiga support BBS in Canada, and on the ab20 Internet site (in
  257. the incoming/amiga/TransAmiga directory).
  258.  
  259.  
  260.  
  261. Closing Comments
  262.  
  263.         Big text file for such a small program, eh? :-)  Well, this is my
  264. first ever program I've written and released to be freely
  265. distributable, so I went all out and wrote lots of stuff on it.  Now
  266. that I'm starting to get the hang of ARexx, I'll be getting more and
  267. more stuff out for TA (and maybe other ARexx programs, who knows).
  268.  
  269. Anyhow, I hope you all like this, and if anyone uses it, let me know,
  270. I wanna know how well it's going over.  Just leave a message on the TA
  271. echo (if you have access to it) would probably be the easiest way.
  272.  
  273.  
  274.  
  275.         Well, this is Todd Courtnage, closing off.
  276.  
  277.