SAY!.COM by Roedy Green 98/10/25 This program is copyrighted but may be used freely for any purpose except military. Purpose ******* SAY! is very similar to SAY in the Ziff Communications PC Powertools. SAY! creates arbitrary strings of characters for use in redirecting to other programs, files or devices. It is like DOS ECHO, except that you can easily embed control characters and high bit characters. SAY! has a pickier syntax that SAY. In SAY, if you forget the " marks, SAY treats the text as a comment, whereas SAY! treats it as an error. Examples ******** SAY! "Y" 13 | DEL *.* - automatically answers the "Are you sure?" prompt with Y SAY! "Brown" 13 "Yellow" 9 | MyColour.Exe - you may have any number of "enclosed strings" or decimal numbers for the ASCII codes of the keystrokes (not scan codes). - to get the " itself, use code 34. SAY! /H - this or any other syntax error will give you a little help. SAY! "Mary had a little lamb" 13 10 "Its fleece .." 173 13 10 > RHYME.DAT - create a file perhaps containing strange characters Say! 27 "&l5257.1058J" 26 > LPT1: - put HP printer into Postscript mode with Pacific Page Say! 27 "&l1057.32259J" > LPT1: - put HP printer into native PCL non-Postscript mode Say! "This is a line tacked on the end of a file" 13 10 26 >> MyFile.Dat - using >> appends to the end of an existing file. - be careful if the file already has a 26. When you are done you will have a 26 (EOF) embedded. Use CLEANSER to get rid of these pests. SAY! 7 7 7 "The sky is falling" - you don't HAVE to redirect the output of SAY!. If you don't it just displays on the screen, much the same as Echo. What is SAY! for? ***************** Use SAY! wherever you would normall use ECHO and you want to be very precise about exactly how many spaces go on the front and end of the string. With SAY! you can construct files with exactly the line endings, eof chars etc. you specify. SAY! never adds ANYTHING in you did not ask for. Use SAY! when your strings contain awkward characters like ESC (27), or invisible spaces (255), or characters that might confuse your printer or editor FormFeed (12). If you were to say: Echo Please press then the vertical bar | DOS would get very confused, since it reserves < > and | for use in controlling pipes. Instead you could say: SAY! "Please press " 60 "Enter" 62 " then the vertical bar " 124 SAY! does NOT understand expressions like ^G for control G. You must use the numeric equivalents, e.g. 7. When NOT to use SAY! ******************** SAY! simply emits a string of characters. If, for example, you pipe it into a program to fake input keystrokes, once the program has swallowed all those characters, it will just HANG -- waiting for the pipe to produce some more. If you want to use SAY! to jump start a program -- i.e. just give a program some initial keystrokes then hand over control back to the keyboard, you will need a different sort of program called a keystuffer. If you try to use SAY! in this way, it will just freeze the machine. The Magic Numbers ***************** Each of the numbers 0 to 255 will get you a character. BASIC programmers refer to these as the CHR$ numbers. You can use "A" or 65. Both will get you a capital A. Common interesting numbers are: 3 - heart 4 - diamond 5 - club 6 - spade 7 - Beep 9 - Tab 10 - Line Feed 12 - form feed 13 - Enter (in files, lines end with 13 10) 26 - ^Z -- end of file mark 27 - ESC 34 - " 60 - < 62 - > 124 - | 174 - << 175 - >> 255 - alternate space You can buy a wall chart showing all the characters and their numbers from Falk Data Systems, 5322 Rockwood Court, El Paso Texas, 79932 (915) 584-7670. There are charts in most of the IBM Tech reference manuals as well. GETTING THE LATEST VERSION ************************** Look for the latest version at my Web site: http://mindprod.com It would also be helpful if you mentioned the URL or source of where you got your copy. I want to make sure that site is kept kept up to date. Author ****** Roedy Green Canadian Mind Products #101 - 2536 Wark Street Victoria, BC Canada V8T 4G8 tel:(250) 361-9093 mailto:roedyg@mindprod.com http://mindprod.com -30-