home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / TSPA3340.ZIP / TSPAS.NWS < prev    next >
Text File  |  1993-08-16  |  34KB  |  652 lines

  1. News on the TSPAS package by Timo Salmi in reverse order
  2. ========================================================
  3.  
  4. University of Vaasa, Finland, Sun SPARCstation IPX garbo.uwasa.fi
  5. has a large collection of PD and shareware PC programs available by
  6. anonymous ftp and mail server. The file /pc/ts/0news-ts contains
  7. news about the TS-programs in the /pc/ts directory (in reverse
  8. order). This text, which you now have, is an extract from the
  9. 0news-ts file and the UseNet news.
  10. ..................................................................
  11. Prof. Timo Salmi      Co-moderator of comp.archives.msdos.announce
  12. Moderating  at  garbo.uwasa.fi anonymous FTP archives 128.214.87.1
  13. Faculty of Accounting & Industrial Management; University of Vaasa
  14. Internet:  ts@uwasa.fi  Bitnet:  salmi@finfun; FI-65101,   Finland
  15. ..................................................................
  16.  
  17. ┌────────────────────────────────────────────────────────────────┐
  18. │ Appeal: Let me take up a request for those of you who may have │
  19. │ found my programs or units useful.  As I am not asking for a   │
  20. │ registration fee for private versions, would you do me a       │
  21. │ reciprocal favor by uploading at least some of my packages to, │
  22. │ say eg one local bulletin board (BBS), and thus contribute to  │
  23. │ disseminating the *latest* versions of these packages.  And,   │
  24. │ if you distribute these packages, would you PLEASE distribute  │
  25. │ an entire package, not individual programs from within any     │
  26. │ package. This is a request that all of us share who write      │
  27. │ freeware and shareware programs.                               │
  28. └────────────────────────────────────────────────────────────────┘
  29.  
  30. Mon 16-Aug-93: Based on some welcome feedback and on my own
  31. observations I have released an update of my Turbo Pascal units
  32. collection. It is now garbo.uwasa.fi:/pc/ts/tspa33*.zip where * =
  33. 40,50,55,60,70.
  34. Added to unit TSUNTC the reversal of enabling hi-intensity
  35. background
  36.   BLBACK "Cancel HIBACK enabling usage of blinking text"
  37. Added to TSUNTG
  38.   ISRAMFN "Is a drive a probable ramdisk"
  39. Corrected a bug giving occasional random results in TSUNTH
  40.   LASTDRFN "Get last drive of the system, softcoded, not XTs"
  41. If you have used LASTDRFN, you should compile your program anew.
  42. Added to TSUNTJ
  43.   ISDIR3FN "Is a name a directory or not", a slower and surer method
  44. see garbo.uwasa.fi:/pc/ts/tsfaqp*.zip for details of ISDIR3FN.
  45. Reprogrammed in TSUNTENV unit
  46.   SETENV "Set a parent environment variable (variable=value)"
  47. It now accepts equal signs in the 'value'. I also added an example
  48. to TSUNTENV.TST to show how to set several environment variable
  49. values.
  50. Moved to a new TSUNTBOT unit from TSUNTG
  51.   COLDBOOT "Reboot computer, including memory tests"
  52.   WARMBOOT "Warm reboot of the computer (as alt-ctrl-del)"
  53. and added to this new unit
  54.   REBOOT   "Reboot computer with disk closing and cache flushing"
  55.  
  56. Wed 24-Feb-93: I have updated my Turbo Pascal units collection. It
  57. is now garbo.uwasa.fi:/pc/ts/tspa32*.zip where * = 40,50,55,60,70.
  58.    I replaced CHIPFN "Get the type of the processor chip" with
  59. CPUFN. It should detect also a 486 while CHIPFN did not. My thanks
  60. to Duncan Murdoch for his help in this.
  61.    The new routines added are
  62.   ISEGAFN  Is at least an EGA present. No graph unit needed
  63.   NOLABEL  Delete a disk's volume label.
  64.   SCROLLDN Scroll down a window. No Crt unit needed
  65.   SCROLLUP Scroll up a window. No Crt unit needed
  66.   SETLABEL Set a disk's volume label.
  67.  
  68. Sat 23-Jan-93: As all Turbo Pascal users know to our common chagrin
  69. the different Turbo Pascal version TPUs are not compatible across
  70. the versions. I have made a Turbo Pascal 7.0 real mode compatible
  71. rendition of my Turbo Pascal units garbo.uwasa.fi:/pc/ts/
  72. tspa3170.zip.
  73.    Since some users may ask, I am not going to make protected mode
  74. nor TPW compatible versions. Protected mode programming has quirks
  75. of it own, and is thus specialized. As for TPW, I do not use Windows
  76. myself, and have thus no real interest of supporting it.
  77.   The other, non-updated versions are
  78.     garbo.uwasa.fi:/pc/ts/tspa3140.zip
  79.     garbo.uwasa.fi:/pc/ts/tspa3150.zip
  80.     garbo.uwasa.fi:/pc/ts/tspa3155.zip
  81.     garbo.uwasa.fi:/pc/ts/tspa3160.zip
  82.  
  83. Sun 8-Nov-92: I have again updated my Turbo Pascal units collection.
  84. It is now garbo.uwasa.fi:/pc/ts/tspa31*.zip where * = 40,50,55,60.
  85. The new routines added are
  86.  TSUNTB:
  87.    BBINFN   Convert decimal byte to binary string
  88.    BHEXFN   Convert decimal byte to hexadecimal string
  89.  TSUNTE:
  90.    ARCFILFN Is a file's archive bit set or not
  91.    HIDFILFN Is a file a hidden file or not
  92.    RDOFILFN Is a file a read-only file or not
  93.    SYSFILFN Is a file a system file or not
  94.  TSUNTG:
  95.    ACTDRVFN Which floppy drive is active on a one drive system
  96.    FLOPSTFN Floppy disk status. Is it present and formatted.
  97.    ISUBSTFN Is a drive a substituted drive (MsDos 3.1+)
  98.    MEDIAFN  What kind of a disk media is present in a drive
  99.               returns: $00 : Error
  100.                        $F0 : Floppy of 1.44Mb
  101.                        $F8 : Fixed disk
  102.                        $F9 : Floppy of 1.2Mb
  103.                        $FA : Floppy of 720Kb
  104.                        $FD : Floppy of 360Kb
  105.                        $FF : Floppy of 320Kb
  106.  TSUNTJ
  107.    ISDIR2FN Is a name a directory or not, alternative method
  108.  
  109. Sun 20-Sep-92: In my Turbo Pascal units there is a number of
  110. editable readln substitutes:
  111.  TSUNTF: (uses Dos, Crt)
  112.   EDRDLN   Readln with line-editing potential (the simplest)
  113.   EDREABLN Edreadln with ctrl-c and break trapping
  114.   EDREADLN Editable Readln with recall, and insert toggle
  115. I have written alternative versions of these routines which can take
  116. a PrefillString as the default input string, so the user has an
  117. option of just pressing enter, and default is selected.
  118.   EDRDEBLN Editable Readln with ctrl-c, break trapping, pre-fill etc
  119.   EDRDEFLN Editable Readln with recall, pre-fill, and insert toggle
  120. The suggestion to make this enhancement came from Darrell Davis
  121. davisd@ziavms.enmu.edu. My thanks to Darrell for his useful
  122. suggestion.
  123.  garbo.uwasa.fi:/pc/ts/tspa3040.zip
  124.  garbo.uwasa.fi:/pc/ts/tspa3050.zip
  125.  garbo.uwasa.fi:/pc/ts/tspa3055.zip
  126.  garbo.uwasa.fi:/pc/ts/tspa3060.zip
  127.  
  128. Wed 26-Aug-92: Updated my Turbo Pascal units collection. It is now
  129.  garbo.uwasa.fi:/pc/ts/tspa29*.zip
  130. where * = 40,50,55,60.
  131.    Bug fixed (hopefully) the ISDIRFN "Is a name a directory or not"
  132. function in TSUNTJ unit. My thanks are due to Richard (Ricki) Breuer
  133. ricki@rwthi3.informatik.rwth-aachen.de for alerting me to the
  134. problem.
  135.    In the process we noticed a rather undesirable feature of DRDOS.
  136. All my units are written for MsDos (command.com). The alternative
  137. command interpreters like DRDOS and 4DOS can cause incompatibilities
  138. since some of Turbo Pascal's routines (like IOResult) utilize the
  139. values the system returns. There is nothing I can do about
  140. incompatibilities like this, and it is a coincidence that we even
  141. noticed, since I do not run 4DOS or DRDOS. Anyway, ISDIRFN eill not
  142. work as expected if you are using DRDOS. I do not know about 4DOS.
  143.    SETENV "Set a parent environment variable (variable=value)" in
  144. the TSUNTENV unit now accepts cases like TARGET=A B C (formerly the
  145. it was cut at the spaces).  Also this suggestion is to to Ricki. Be
  146. careful.  Trailing white spaces and other invisible characters you
  147. might put in there are included. Thus "TARGET=A" and "TARGET=A " are
  148. not the same thing.
  149.    Started a new 4.0+ specific unit TSUNTK. It contains the
  150. following routines.
  151.   BOOTDRFN Get boot device name (MsDos 4.0+)
  152.   GETSERFN Get disk's serial number (MsDos 4.0+)
  153.   GETVOLFN Special get disk volume label (MsDos 4.0+)
  154.   SETSER   Set floppy's serial number (MsDos 4.0+)
  155. The first, that is BOOTDRFN was transferred from the TSUNTH unit.
  156. The others are brand new. I got the idea to get and set the disk
  157. serial number from PC-Magazine (July 1992, Vol. 11, No. 13, p. 496)
  158. which published TP 6.0 specific code for these tasks. Since my own
  159. TP units are more general, that is for all the current MsDos TP
  160. versions starting from TP 4.0, I decided to write routines of my own
  161. for these tasks. But the users interested in a source code may wish
  162. to look at the article.  (I did not bother to test whether the
  163. PC-Magazine code works, but I don't see why not). I got interested
  164. because I now use MsDos 5.0 in addition to 3.30 and 3.21 (and the
  165. aggravating 4.01).
  166.    Added HEXLNGFN "Convert hexadecimal string to decimal longint up
  167. to 7FFFFFFF" to the conversion unit TSUNTB because TSUNTK internally
  168. needs this conversion in accessing the disk serial number.
  169.    Added to TSUNTE the following elementary routines, just because I
  170. occasionally happen to need them myself.
  171.   LABELFN  Get a disk's volume label (not for TP 4.0)
  172.   DEFDRVFN Get the default drive
  173.    Finally added HIBACK to TSUNTC to enable high intensity
  174. background colors instead of enabling blinking text. The appropriate
  175. interrupt was pointed out by Robert Beauchaine bobb@vice.ICO.TEK.COM
  176. on the UseNet news in comp.lang.pascal. The routine requires an EGA,
  177. MCGA, or a VGA.
  178.  
  179. Sat 13-Jun-92: Updated my Turbo Pascal units collection. It is now
  180.  garbo.uwasa.fi:/pc/ts/tspa28*.zip
  181. where * = 40,50,55,60.
  182. Added to TSUNTG unit
  183.   GETESCAN Get scancode of key pressed, enhanced keyboard.
  184.   GETSCAN  Get scancode of key pressed, XT keyboard.
  185. The TSUNTENV unit already had
  186.   SETENV   Set a parent environment variable (variable=value).
  187. but this takes effect only after the program has been completed.
  188. Added an alternative which takes effect immediately, but is
  189. temporary
  190.   SETENVSH Set an environment variable for the duration of shelling.
  191. One of the handy uses of SETENVSH is that you can temporarily change
  192. the prompt to indicate that you are shelled out of a program so that
  193. you are less likely to forget to type exit. See TSUNTG.TST for how
  194. to use this feature.
  195.  
  196. Sat 8-Feb-92: I have updated my Turbo Pascal units collection to be
  197.  garbo.uwasa.fi:/pc/ts/tspa2740.zip
  198.  garbo.uwasa.fi:/pc/ts/tspa2750.zip
  199.  garbo.uwasa.fi:/pc/ts/tspa2755.zip
  200.  garbo.uwasa.fi:/pc/ts/tspa2760.zip
  201. This time I have introduced (parent) environment related routines in
  202. a new TSUNTENV.TPU unit
  203.   ENVSIZFN Get the size of the parent environment
  204.   ENVUSEFN Get the current use of the parent environment
  205.   ENVADDFN Get the starting segment address of the parent environment
  206.   SETENV   Set a parent environment variable (as MsDos SET var=value)
  207.   SHOWENV  Write the parent environment table on stdout (for testing)
  208. Setting a parent environment variable from within a Turbo Pascal
  209. program can be considered reasonably advanced programming I guess,
  210. and I cannot be absolutely sure that I got it right. But here goes
  211. anyway. The key to the task is obtaining the starting address of the
  212. parent environment, and knowing that the format of the parent
  213. environment table in memory is
  214.       name=value1<nul>name=value2<nul>...name=valueN<nul><nul>.
  215. PC Magazine Vol. 11, No. 1, pp. 425-427 has useful code which can be
  216. adapted to find out the relevant segment address. Should you look at
  217. that article, the crucial variable to get at in there is EnvSeg. The
  218. rest then follows. What a delightfully complicated challenge.
  219.    Oh yes, since I know that some users will be asking for the
  220. source code. I am happy to share this reference, and make my .TPU
  221. collection publicly available, but I have chosen not to distribute
  222. by source codes.
  223.    In fact I have not added the unit to the tspas2740.zip TP 4.0
  224. version TPUs, but I have updated it nevertheless to avoid confusion
  225. with the version numbers.
  226.  
  227. Mon 6-Jan-92: I have updated my Turbo Pascal units collection to be
  228.  garbo.uwasa.fi:/pc/ts/tspa2640.zip
  229.  garbo.uwasa.fi:/pc/ts/tspa2650.zip
  230.  garbo.uwasa.fi:/pc/ts/tspa2655.zip
  231.  garbo.uwasa.fi:/pc/ts/tspa2660.zip
  232. by transferring the following routines from TSUNTH.TPU unit to a new
  233. TSUNTJ.TPU unit
  234.   COPYFILE Copy a file from within a Turbo Pascal program
  235.   OPENEDFN Is an assigned textfile still open or not
  236.   ISDIRFN  Is a name a directory or not
  237.   PIPEDIFN Is the standard input from redirection
  238.   PIPEDNFN Is the standard output redirected to nul
  239.   PIPEDOFN Is the standard output redirected
  240. by adding the following routines to TSUNTJ.TPU
  241.   INTRADDR Show the memory address to which the interrupt points
  242.   INTRLOCA Show the memory address where the interrupt is located
  243. and by adding the following routines to TSUNTH.TPU
  244.   ISMOUSFN A simple true/true false test of mouse available
  245.   MOUSTAFN Status (type byte) of the mouse hardware and driver
  246. My thanks are due to Duncan Murdoch in particular who first noted a
  247. potential error in the early version of my mouse functions.
  248.    The first of the sets garbo.uwasa.fi:/pc/ts/tspa2640.zip contains
  249. a compatibility unit TSUNT45.TPU for Turbo Pascal 4.0. It adds
  250. routines that the later versions have, but which are missing in
  251. version 4.0. I have added
  252.   GetVerify Get the status of the MsDos write verify flag
  253.   SetVerify Set the status of the MsDos write verify flag
  254.   GetCBreak Get the state of Ctr-Break checking in DOS
  255.   SetCBreak Set the state of Ctr-Break checking in DOS
  256.  
  257. Sun 27-Oct-91: I have updated my Turbo Pascal units collection to be
  258.  garbo.uwasa.fi:/pc/ts/tspa2540.arc
  259.  garbo.uwasa.fi:/pc/ts/tspa2550.arc
  260.  garbo.uwasa.fi:/pc/ts/tspa2555.arc
  261.  garbo.uwasa.fi:/pc/ts/tspa2560.arc
  262. by adding the following routines
  263.   ISANSIFN Has ansi.sys a a similar driver been loaded
  264.   BTEWRDFN Combine two bytes into a single word, inverse of Hi & Lo
  265.   WRDLNGFN Combine two words into a longint
  266.   HIWORDFN The high-order (hi) word of the longint argument
  267.   LOWORDFN The low-order (lo) word of the longint argument
  268.  
  269. Sun 21-Jul-91: I have updated my Turbo Pascal units collection to be
  270. /pc/ts/tspa24##.arc (where ## = 40, 50, 55, and 60).
  271.    Turbo Pascal 5.0 (and later) introduced some routines which are
  272. not present in version 4.0. My Turbo Pascal units collection (the
  273. 4.0 version) includes a TSTPU45 unit which introduces some of the
  274. missing routines also to TP 4.0. I have added FExpand (Expand a file
  275. name into a fully qualified file name) to this unit.
  276.    Occasionally you will want to be able to tell where the standard
  277. input to your program comes from.  Does it come in the normal way
  278. from the keyboard, or does it come from redirection. Likewise, you
  279. may wish your program to know whether its standard output goes to
  280. the screen, or is it redirected to a file or through a pipe. The
  281. new boolean functions in the TSUNTH.TPU unit will give this
  282. information:
  283.   PIPEDIFN Is the standard input from redirection
  284.   PIPEDOFN Is the standard output redirected
  285.   PIPEDNFN Is the standard output redirected to nul
  286. Other new routines in the TSUNTH unit include:
  287.   BOOTDRFN Get boot device name (MsDos 4.0+)
  288.   DATEFMFN Country-dependent date format (MsDos 3.0+)
  289.   NRCYLFN  Number of cylinders on a drive if media present (MsDos 3.2+)
  290.   TIMEFMFN Country-dependent time format (MsDos 3.0+)
  291.   Z2ASZFN  Convert an Asciiz string into an ordinary ascii string
  292.  
  293. Tue 8-Jan-91: My Turbo Pascal units collection is now available also
  294. for Turbo Pascal 6.0. It is /pc/ts/tspa2360.arc, and is in no other
  295. way different from tspa2340.arc, tspa2350.arc, and tspa2355.arc
  296. except that the units are for 6.0. As you know, Turbo Pascal units
  297. are not compatible across versions.
  298.  
  299. Sat 5-Jan-91: I have upgraded my Turbo Pascal units collection at
  300. uwasa.fi archives by making several changes. Most importantly I have
  301. divided the package into three parallel packages:
  302.   tspa2340.arc  for Turbo Pascal 4.0 version
  303.   tspa2350.arc  for Turbo Pascal 5.0 version
  304.   tspa2355.arc  for Turbo Pascal 5.5 version
  305. Thus you'll only need the package concurring with the Turbo Pascal
  306. version you use yourself. With the exception of the differences
  307. inherent to the different releases of Turbo Pascal, the packages are
  308. the same.
  309.    I am expecting Turbo Pascal 6.0, but it has not arrived yet.
  310.    I have added a new unit TSERR.TPU which turn on the verbal
  311. run-time error messages. It is very easy to use. Just include
  312.  uses TSERR;
  313. at the beginning of your main program and you'll have verbal
  314. run-time error messages besides the original, cryptic error codes.
  315.    I have done some cleaning of the old units by omitting some of
  316. the older routines which have a more efficient later replacement. In
  317. particular this concerns the functions for converting values from
  318. one base to another.
  319.    There are also new routines:
  320.   PARSENFN Number of substrings in a string (resembles ParamCount)
  321.   PARSERFN Get substrings from a string (resembles ParamStr)
  322.   FATSFN   Get number of file allocation tables, not XTs
  323.   INTERLFN Get interleave coefficient of a harddisk, not XTs
  324.   LASTDRFN Get last drive of the system, softcoded, not XTs
  325. and the generic power function POWERGFN has been rewritten.
  326.  
  327. Wed 8-Aug-90: I have updated my Turbo Pascal (4.0, 5.0, 5.5) units
  328. collection to be version (/pc/ts/)tspas22.arc.
  329.    There are several functions which Tubro Pascal 5.0 and 5.5 have,
  330. but TP 4.0 does not.  I have added a new unit tsunt45.tpu which
  331. includes some of these functions such as EnvCount, EnvStr, GetEnv,
  332. and ParamStr0 (giving the name of the program).
  333.    The unit tsunti.tpu can be used to put information into the .exe
  334. file and perform selftests of the .exe.  This unit is now also
  335. available for TP 4.0.
  336.    Turbo Pascal ReadKey lacks the ability to read special keys such
  337. as RightShift, LeftShift, RightCtrl, and so on.  Functions to detect
  338. pressing these keys have been added.
  339.    Turbo Pascal ReadKey also lacks the ability to cope with the full
  340. enhanced keyboard potential. This means that TP ReadKey does not
  341. detect pressing F11 or F12, and that it cannot distinguish between
  342. the numeric keyboard cursor keys and the grey cursor keys. I have
  343. added a RDENKEFN function which has these abilities.
  344.  
  345. Wed 1-Aug-90: I have updated my Turbo Pascal (4.0, 5.0, 5.5) units
  346. collection to be version (/pc/ts/)tspas21.arc.
  347.    Turbo Pascal version 4.0 does not have the DosVersion function
  348. available in versions 5.0 and 5.5. I have written this function for
  349. version 4.0. Furthermore the lack of this function caused errors in
  350. TP 4.0 versions of my last two units.  This has been put right.
  351.    I have included a new unit (tsunti.tpu) for putting information
  352. into the .exe file, and retrieving the information (not for TP 4.0).
  353. The routines include a method for calculating the direct checksum
  354. for a file (eg for virus checking). This is not as trivial as it may
  355. sound at first sight, because in calculating the checksum, the
  356. checksum constant within the program must be skipped. (Else a change
  357. in the checksum constant would alter the checksum resulting in a
  358. "vicous circle"). Also, the method must be fast enough.
  359.    I have also included a fast a date and filesize checking method
  360. for detecting if the .exe has been pacthed or its size altered. (Of
  361. course, the checksum method is much more difficult to defeat, but it
  362. is more complicated and not as fast). Here I have made an exception
  363. and included the source code. It is in the selftest.pas file within
  364. tspas21.arc.
  365.  
  366. Mon 23-Jul-90: I have updated my Turbo Pascal (4.0, 5.0, 5.5) units
  367. collection to be version (/pc/ts/)tspas20.arc.
  368.    One problem area that has intrigued me for some time is finding a
  369. technique for storing information within an executable file and
  370. updating that information. I've looked into it and written a couple
  371. of relevant procedures. USECOUNT keeps track of how many times the
  372. program has been run and stores the result within the .exe file.
  373. BRANDEXE is a more general, but also a more complicated procedure
  374. for .exe file handling. As an example I have a demonstration how to
  375. tell the previous time when the program was run.
  376.    The function checking the on-line status of the printer
  377. (prnonlfn) has been rewritten to work without Turbo Pascal's Crt
  378. unit. And an alternative printer on-line status function, LTPONLFN,
  379. has been added. This one should be more robust, because it actually
  380. tries to send a carriage return to the printer, and observes the
  381. resultant success of the operation to define the on-line status. Of
  382. course this is achieved by {$I-} {$I+} IOResult testing, but the
  383. real trick here is make to system respond immediately rather than in
  384. the default response time of up to one minute. A new procedure
  385. PRTSCR sends the current screen to the printer. The new routines
  386. GETPRTFN and SETPRT get and set respectively the number of printer
  387. default retry times before a timeout.
  388.    TICKSFN is a simple complement to the TIMERFN already in the
  389. collection. TICKSFN gives the number of clock ticks (there are 18.2
  390. per second) since midnight.
  391.    A new LASTDMFN returns the number of days in a given month and
  392. year. DATEOKFN tells whether a date is a valid, existing date.
  393. ZELLERFN lets you compare which of the two dates is earlier,
  394. calculate the number of days between two dates etc.
  395.    A new FIXEDFN returns whether a drive is a fixed disk or not.
  396. MATHCOFN returns if a math coprocessor is present. RS232FN returns
  397. the number of serial ports. PARPORFN returns the number of parallel
  398. ports. COUNTRFN returns the country code. CHIPFN returns the type of
  399. the processor chip.
  400.    There are new keyboard routines. SCRLONFN gets the current
  401. ScrollLock status. CAPS, NUMLOCK, and SCRLOCK respectively set the
  402. CapsLock, NumLock and ScrollLock on, or off. They take the desired
  403. status as a boolean argument.
  404.   CLS sets 25*80 text mode and clears the screen and CLS40 does
  405. likewise for 25*40. Crt is not required.
  406.    So far none of the routines in the TSPAS collection have included
  407. any inline code. Starting from tspas20.arc this no longer holds. I
  408. have tried to understand some assembler and have included also
  409. inline code. Be warned that I cannot give any guarantees that the
  410. inline coded routines won't cause confusion.  Where inline code has
  411. been used, I have stated so. The first function to utilize this is
  412. LOWCASFN which is the exact opposite of Turbo Pascal's own UpCase
  413. function.
  414.    WARMBOOT simulating alt-clr-del, and COLDBOOT reboot with memory
  415. tests are new, inline routines.
  416.    A couple of routines have been moved from one unit to another.
  417.  
  418. Newsgroups: comp.lang.pascal
  419. From: ts@chyde.uwasa.fi (Timo Salmi)
  420. Subject: Redirecting writes to the printer
  421. Organization: University of Vaasa
  422. Date: Sun, 22 Jul 90 03:58:00 GMT
  423. (*
  424. About half a year ago several posters wanted to find a way to direct
  425. all output to the printer. (To enable a documentation of students'
  426. programming tasks.) For some reason nobody of us then found a simple
  427. working solution, which is outrageously elementary, after fact.
  428. There are, of course, alternative solutions, the most complicated
  429. being writing a new device driver. An intermediate (easier) solution
  430. is to juggle with certain TP predefined constants. I have two
  431. procedures USECON and USEPRN (in /pc/ts/tspas19.arc tpu collection)
  432. which when placed anywhere within the program will change the output
  433. device. But below is an example the the easiest alternative needing
  434. no accessories.
  435. *)
  436. program HowToRedirectAllOutputEasilyToThePrinter;
  437. {$DEFINE printit}
  438. begin
  439.   {$IFDEF printit}
  440.   assign (output, 'prn');
  441.   rewrite (output);
  442.   {$ENDIF}
  443.   :
  444.   writeln ('From Timo Salmi: Hello world, and whatever else');
  445.   :
  446.   {$IFDEF printit}
  447.   close (output);
  448.   {$ENDIF}
  449. end.  (* thus endeth the escapade *)
  450.  
  451. Thu 14-Jun-90: I have updated my Turbo Pascal (4.0, 5.0, 5.5) units
  452. collection to be version (/pc/ts/)tspas19.arc. The function INDRIVFN
  453. in tsuntg.tpu tests whether a device is present in a drive. If you
  454. defined an invalid drive (such as '1'), a run time error occurred in
  455. my earlier versions. - Tsunta.tpu has a new function HIGHTFN, which
  456. gives the height of the screen by resolution (25, 43 or 50). -
  457. Tsuntf.tpu has a third enhanced readln with line editing, recall,
  458. insert toggle, and clean break potential. - Tsunth.tpu includes a
  459. new function ISDIRFNto test whether a name is a directory. -
  460. COPYFILE procedure copies a file from within a Turbo Pascal program
  461. and returns a success status code. I have seen postings in the
  462. (InterNet) news about problems with copying files in Turbo Pascal,
  463. but I hope that this one should do the trick. - OPENEDFN function
  464. indicates whether a text file has already been closed within the
  465. program, or if it is still open. This is particularly convenient for
  466. procedures aborting your program. - Tsuntd includes a new procedure
  467. called AUDIO. It is an enhanced version of Turbo Pascal's own sound
  468. procedure. It takes frequency and duration as parameters, and it
  469. does not need the presence of the interfering Crt unit. Audio was
  470. written in collaboration with Ari Hovila (ajh@chyde.uwasa.fi). - And
  471. since I am often asked the question, sorry, no, dear fellow users,
  472. the sources are not available, only the units and their documented
  473. interfaces.
  474.  
  475. Sun 25-Feb-90: I have gotten repeated requests from the users for a
  476. Turbo Pascal 5.5 version of my Turbo Pascal units collection. I now
  477. have finally got the 5.5 compiler, courtesy of University of Vaasa,
  478. because it was felt here that this international interaction is
  479. important enough to warrant the expense. (As I have told many of the
  480. users who have contacted me in this matter, I am not yet interested
  481. in OOP myself). Hence I am in a position to oblige. The new version
  482. is called tspas18.arc. There is only one new function in the
  483. collection this time. The main point was providing the TP 5.5
  484. versions of the units. Thus there are now three versions of each
  485. unit in this new release: TP 4.0, 5.5, and 5.5. - It is true that
  486. Borland has made excellent products for the PC community, but the
  487. incompatibility between the TPUs of the different Turbo Pascal
  488. versions has many of us users disgruntled.
  489.  
  490. Wed 6-Dec-89: Updated the Turbo Pascal 5.0 (and 4.0) units
  491. collection to be version /pc/ts/tspas17. The new procedures include
  492. WHEREXFN and WHEREYFN which locate the cursor position without the
  493. Crt unit. As you will recall Crt unit includes a WhereX and a WhereY
  494. function. The reason I have prepared alternatives to Crt functions
  495. and procedures in this, and the earlier releases, is because with
  496. some incompatible PCs the Crt unit causes problems, and redirection
  497. requires special measures with the Crt. - KEYPREFN is a replacement
  498. of KeyPressed and READKEFN for ReadKey. - CLUSIZFN gives the cluster
  499. size on a device. ALLSIZFN gives the true total size allocated to a
  500. file instead of the size shown on ordinary directory listings. -
  501. INKEYFN is a Basic-like timed input.
  502.  
  503. Tue 28-Nov-89: Some time ago there was a lively discussion in the
  504. InterNet news group comp.lang.pascal how to redirect all write and
  505. writeln statements to the printer without having to change the
  506. statements. I now have a solution to that problem for Turbo Pascal
  507. 4.0 and 5.0. The procedures USEPRN and USECON are part of update
  508. /pc/ts/tspas16.arc of my Turbo Pascal 5.0 and 4.0 units collection.
  509. The new procedures/functions also include WEEKNRFN function in the
  510. TSUNTE unit. It gives the weeknumber for a given date. REVCOLOR in
  511. TSUNTC reverses (toggles) text colors. And there are many other new
  512. routines making up a new unit TSUNTG.
  513.  
  514. Thu 26-Oct-89: I have a private mailing list for emailing these
  515. update news. Especially, if you have my programs downloadable at
  516. your site or your BBS you are welcome to ask for inclusion on this
  517. list.
  518.  
  519. Wed 18-Oct-89: Released update /pc/ts/tspas15.arc of my Turbo Pascal
  520. 5.0 and 4.0 units collection. New procedures/functions include BINFN
  521. in TSUNTB for fast conversion of decimal words to binary and HEXFN
  522. for fast conversion to hexadecimal. LBIN and LHEX convert long
  523. integers fast to binary and hexadecimal respectively. POWERLFN
  524. raises a longint to a power, fast. BORDER in TSUNTE changes the
  525. border color for CGA or VGA. All the rest of the procedures and
  526. functions remain unchanged.
  527.  
  528. Tue 26-Sep-89: Released update /pc/ts/tspas14.arc of the Turbo
  529. Pascal 5.0 and 4.0 units collection. The package contains units from
  530. tsunta.tpu to tsuntf.tpu. Tsunte.tpu contains a new function
  531. cmdlnfn, which gives the entire command line in a program call. The
  532. input line-editing procedure edreadln in tsuntf.tpu now has a recall
  533. option (CursorUp) and the insert key toggle. I have preserved an
  534. edrdln procedure for line-editing without recall and insert. Tsuntd
  535. has new ParamCount and ParamStr like functions for obtaining
  536. substrings from a string.
  537.  
  538. Sat 19-Aug-89: Released update /pc/ts/tspas13.arc of my Turbo Pascal
  539. units.  I have rewritten the cursor-size routines in a more general
  540. fashion and rearranged the units. 
  541.    One of the weaknesses of the readln statement in (Turbo) Pascal
  542. is that it does not allow editing the input-string while giving the
  543. input from the keyboard.  I decided to do something about this, and
  544. wrote an edreadln procedure, which allows to use of LeftCursor,
  545. RightCursor, BackSpace, Del, Home, End, and Esc.  Of course such
  546. routines are very common in input from popup windows.  Edreadln is,
  547. however, more of a readln-type procedure with normal scrolling
  548. capabilities, than a fixed position window routine.  This routine is
  549. included in the new release. 
  550.  
  551. Wed 2-Aug-89: I have released un updated version of the Turbo Pascal
  552. units collection tspas12.arc.  There are new string routines and
  553. detection of the monitor (mono/color) type.
  554.  
  555.  
  556. =======================================================================
  557.                   Messages from UseNet news
  558. =======================================================================
  559.  
  560. From ts Sat Jul 28 09:25:43 1990
  561. Subject: Re: Program selftesting and viruses
  562. To: 16012_3045@uwovax.uwo.ca (Paul Gomme)
  563. Date: Sat, 28 Jul 90 9:25:43 EET DST
  564. In-Reply-To: <0649102756@uwovax.uwo.ca>; from "Paul Gomme" at Jul 27, 90 6:19 pm
  565. X-Mailer: ELM [version 2.2 PL16]
  566. Status: OR
  567.  
  568. > >     Programmers: Help fighting viruses and patching.
  569. > >
  570. > >Viruses and unauthorized patching are problems which should be
  571. > >fought against by the PC community. This program demonstrates a
  572. > >simple and a reasonably general, fast selftest to detect whether the
  573. > >program has caught a virus, or if it has been amateurishly patched.
  574. > >The code is easily incorporated in any Turbo Pascal source code. The
  575. > >idea is to check whether the file date and size have been altered.
  576. > >Most .exe viruses work by appending their code to the .exe file
  577. > >altering the file size. Trivial patching changes the file date.
  578. > >Either of these is detected by selftest.
  579. > While the idea may have some merits, the execution is flawed.
  580.                                                         ^^^^^^
  581. No Paul, not flawed.  Rather not foolproof, nor is meant to be. 
  582.  
  583. > First, it is a minor matter to obtain the creation date of a file. 
  584. > Consequently, it is a relatively simple matter to apply a patch
  585. > which doesn't alter the file size, and restore the original creation
  586. > date.  Your technique is subject to such an "attack". 
  587.  
  588. Certainly.  The whole philosophy behind is to have a simple method
  589. which staves off any crude attempts.  The problem with the more
  590. elaborate selfchecks (such as embedded checksums) is that they are
  591. difficult to implement. 
  592.  
  593. > Second, there are often good reasons to patch a file.  Some of these
  594. > reasons are cosmetic in nature.  Some programs even encourage user
  595. > patching. 
  596.  
  597. Also true, and then such patching should take care of the date.  Or
  598. the selftest should have a relevant modification or omission of the
  599. date test. 
  600.  
  601. > From a more philosophical point of view, I wonder if protection
  602. > schemes don't in part encourage those who write viruses.  Surely
  603. > part of the "thrill" is to avoid detection. 
  604.  
  605. Maybe.  It can be looked at as a kind of a game.  Nevertheless,
  606. consider the popularity eg McAfee's virus control programs have
  607. gained.  Throwing one's hands up in the air is not a good solution. 
  608.  
  609. All the best, Timo
  610.  
  611. =======================================================================
  612.  
  613. From ts Tue Jul 31 12:07:13 1990
  614. Return-Path: <ts>
  615. Received: by uwasa.fi (4.1/(hh)29May89)
  616.     id AA08907; Tue, 31 Jul 90 12:07:12 +0300
  617. From: Timo Salmi LASK <ts>
  618. Message-Id: <9007310907.AA08907@uwasa.fi>
  619. Subject: selftest
  620. To: ts (Timo Salmi LASK)
  621. Date: Tue, 31 Jul 90 12:07:11 EET DST
  622. X-Mailer: ELM [version 2.2 PL16]
  623. Status: O
  624.  
  625. Newsgroups: comp.lang.pascal
  626. Path: uwasa.fi!ts
  627. From: ts@uwasa.fi (Timo Salmi LASK)
  628. Subject: Re: Program selftesting and viruses
  629. Message-ID: <1990Jul31.085732.8728@uwasa.fi>
  630. Organization: University of Vaasa
  631. References: <1990Jul27.182520.12051@uwasa.fi> <1875@krafla.rhi.hi.is>
  632. Date: Tue, 31 Jul 90 08:57:32 GMT
  633.  
  634. In article <1875@krafla.rhi.hi.is> frisk@rhi.hi.is (Fridrik Skulason) writes:
  635. >This program works in most cases - however, it is not effective against some
  636. >of the latest viruses, which fool it by making the program appear unchanged,
  637. >after the virus is in control.
  638.  
  639. This is certainly true, and the purpose of the code is to easily
  640. weed out elementary cases, which are the most frequent anyway.  One
  641. of the points was to make the code simple to understand and include. 
  642. The other alternative is to imbed a checksum in the .exe file.  But
  643. the code is much more complicated, because the checksum (either
  644. direct or crc) constant itself within the program must be skipped
  645. when recalculating the checksum.  Another problem is that the
  646. checksum must be calculated fast.  Else it renders the host program
  647. useless.  I have the code also for calculating and checking the
  648. direct checksum of an .exe file in addition to size & date check. 
  649. This should be fairly effective.  This will be included in the
  650. upcoming update of my Turbo Pascal units tspas21.arc. 
  651.