.UL .DW Contents .DO .UO Editors Forum .................................... 1 News ............................................. 1 The Dutch Connection ............................. 3 QHJ Print Formatter .............................. 6 QROFF Postscript Formatter ....................... 8 2D Arrays in Small-C ............................. 11 .UL .DW Editor's Forum .DO .UO This month has been a busy month for QL news. See the following article to find out what has been going on. This month print formatters are the rage. I did not mean it that way, it's just that two good ideas hit me at about the same time. I hope that others can find them usefull. In the July Issue of Dr. Dobb's Journal, there is an article on Iterated Functions Systems. In our July issue, we also ran an article on Iterated Function Systems. I guess we are not too far behind the rest of the world in our programming endevers. Most of what I could cover here is discussed in the News article, so I'll keep it short. Happy Hacking, .UL .DW News .DO .UO By Tim Swenson In the last month I have recieved quite a bit of QL related news. Most of it is important to the QL programmer. QL International - Bob Dyl of Rhode Island has started a new QL newsletter call QL International. It is designed to be a news source of QL related news gathered from around the world. Bob is in current contact with a number of QL users around the world. It look good and contains some good information. I hope that there will be enough new information about QL's for Bob to publish issues. It costs $10 for a US subscription or $20 for a international subscription. Bob's address is: Bob Dyl, 15 Kilburn Ct., Newport RI 02840. QL-Keyboard-90 Interface - Through one of the QHJ's readers, I have recieved a QL-Keyboard-90 Inteface that allows the QL to use any IBM-type keyboard. The interface plugs into the same socket as the 8049 chip and has the plug end coming out of the QL. Once you have the dip switches set for your keyboard, the interface works great. If you plan to use your QL for years to come, you really need to get one of these. They cost 169 DM (Deutch Marks) and are available from Computer Technik, Thanweg 36, D-7539 Ersinger, Germany Tel: 07321/81058. C68 for the QL - I have heard that there is a version of the public domain C compiler called C68 available for the QL. Dick Taylor of Rhode Island has sent me a copy of the compiler. It is a ported version of the popular C68 compiler. It includes a compiler, preprocessor, assembler, linker, and SROFF file manager. It even has a Make capability. I have just printed out the documentation and am just getting an idea of what it all entails. At first glance, it is quite a system. It comes on a total of seven disks. Bod Dyl of the Seacoast has printed out all of the docs including a C tutorial and plans to make printed copies available for the cost of printing. I am looking into using a document composer at work to make the documents look as good as possible. I am printing up just the main docs and making them avaialable. They will be in the same format as the QHJ (half size paper). If you would like a copy of the C compiler, and the documentation, send $5 to cover costs of the disks, printing, and postage. QL Minix - Also through Dick Taylor, I am getting a hold of the "diff" source code for QL Minix. "Diff" source code is source code needed to make any version of Minix run on the QL. Basically these are the changes to the original source code. You MUST have the full source code for Minix to use these "diff" files. Legally, no one can distrubute the full source code to QL Minix, since Minix is copywrited by Prentice-Hall. This is also available through me. QL Advancement Working Group - There is a new QL group who's main idea in life is to create a "SuperQL." They are working on making updating the QL and making it available to QL users. So fary it looks like they are in the idea stage. For more info contact them at: QLAW, 4 Wasdale Ave, Blackburn, England, BB1 1XD. QL Surviver's Source Book - Also from Bob Dyl is the "QL Surviver's Source Book." It is a collection of QL suppliers, publications, and user groups. (add more here) MicroEmacs 3.9 - I have heard that there someone has ported MicroEmacs 3.9 to the QL. I do not know what extra features it may have, but I am trying to get a copy. I'll have more info when I get it. I do have and use MicroEmacs 3.8b. I also have postscript versions of the manual. The manual looks great and sure beats a dot matrix version. If you do not have access to a postscript printer, I can provide hard copy. QL Journalist - From the Mile High T/S user group (Denver) comes a news item about an English journalist that is researching the state of the Sinclair computing in the US. He is interested in hearing about stories and anecdotes. Take a minute and send him a note and let him know that Sinclairs are still alive in the US. His address is: Robin J. Stevenson 522 Bradgate Road Newtown Linford Leicester, LEwill OHB, UK (0530) 242959 .DW .UL The Dutch Connection .DO .UO By Mark Martin Most QLers probably don't realize what exists overseas for the QL. I also don't think that they realize what exists out there for the QL and a modem. I feel that I can say this because of a few experiences I have had. The first is with GEnie. I subscribed to GEnie for a few months. It was a great place to find files for my Amiga, play intense online MULTIPLAYER games, and talk to people "in the biz". I also found the small, and extremely underpopulated, Orphan section, which also had a few messages for the QL and other Sinclair/Timex machines. It seemed, however, that I was the first, and only, caller to visit the area in some time. I uploaded a terminal (although, I don't know if I got it all), but I think the point was kind of mute. There was simply nobody else there. Adam, Sanyo, and TI fans were abundant, and very conversive. I had always thought that most QL people had at least 1 modem hooked up. All they have to do is call. There are so many things out there to get hooked up with. There are several bulletin boards to get connected to. Bill Miller's group uses the bulletin board called "The Mini File Server BBS", run by Steve Nichols, and written by him. They use it mainly to pass messages and files, but I have also chatted with Steve on it once or twice. Vulcan's magazine, "Computer Monthly" also runs a bbs with 2 phone lines. They also have an orphan sub board, much like GEnie. Although, there, as with GEnie, there is simply no callers. The Chicago group is running some kind of support thing on the Motorola Tech board (or something to that effect), and there, too, like Bill's group, people mainly pass messages and files. Although, I think they are starting some kind of nationwide group, with the home base for pasting articles for their newsletter there as well. The now disbanded Ottawa group is still running a bulletin board off of a real live 2068. The board is called "Sir Clive's Castle", and is run by a very friendly sysop. I happened to run into a capture file there which will lead me into my second point. The capture file was about a bbs in Holland which is hooked into Fidonet, and runs on a real live QL. The board is called "Sinclair Box", and is run under the auspices of the 1200+ member user group in the area. I was unable to connect to the board (something to do with my modem's inability to emulate too many modulation protocols at once), but through that board, I have been able to get in touch with the board run by the author of the software. The author's name is Jan Brendenbeek, and his software is called QBOX, and is currently at version 1.19d. He (among others) has also written a front end, mail tossers, and mail packers, so that a person can run a legitimate board in the Fido net mail network. For those of you unfamiliar with Fidonet, it is a very large network of personal computers that exchange mail (and some files) worldwide to each other. They set their board up to "echo" messages to each other, and also to call each other in the wee hours of the morning to exchange data (so's to not disturb the human callers, and to call when the long distance rates are cheapest). Anyways, Jan runs two boards, one on his QL with a 30 meg Miracle Systems hard drive, and one on a PC type with 200 or so megs. Both are nodes in Fidonet. I also did a bit of calling around Europe; Germany, Holland, England, and God knows where else, with numbers I was able to scrounge from his board. Well, I was able to discover two things from the experience. First, I knew that the American Sinclair echo on Fido net had long since died out. Over there, however, with their greater proportion of QL users and owners, there is still quite a few echos to get in on. I also found out that many of the projects that a few of us have been working on have already been accomplished over there. First, CC68 has long since been ported, and all one has to do is send some disks to an address over there to get the complete package. There is also a lot of users with Minix over there, but the details on that are still shaky. I was able to glean, however, that the Atari ST, Amiga (possibly), and the QL Minix versions are all binary compatible! By that I mean that programs written for the Minix system will run on all three computers, without modifications of any sort! Or this is what I gather at any rate. Along with Qbox 1.19d (a beta test version), I was also able to get some other things from Jan's bbs. First, I was able to get a ZIP file packer and extractor. I haven't been able to test this with the IBM's version, nor to compare the two, but since the program IS pd, I will distribute it to the rest of you guys to see for yourselves. I know that there is also some kind of converter program from the QL zip to the IBM, but I did not download it. I was also able to get a hold of a few other packers/ header strippers, as well as a viewdata terminal, written by Jan. I also was successful at getting a local sysop to get me into the Sinclair echos. Originally, Jan was going to set me up as a point off of his bbs, but then I talked to a local sysop (one of the hubs for the area, as a matter of fact) into picking up the echos, since he was already set up, and also had a more compatible modem (an HST). I am still planning on setting up a bbs to run on my QL, and am still planning to run as a point off of Jan's board. Oh, and one other thing about Jan's board, is that he has designed a third serial port (I forget what chip he used), to overcome the defficiencies of the built in serial ports. He also wrote extended (i.e. carrier detecting) serial drivers for all three serial ports. Qbox won't run right without an extended driver. Jan also devised an access layer for the modem interface, called QSPIL, which separates the communications application from the modem, and standardizes things. I would just like to sum a few things up here. First, I would really like to see more people use their modems a bit more. Grant it, almost all of the calls are going to be long distance, but I usually call after 11pm, when the rates are cheapest, and can usually do a lot for little money. I am also dead set right now on finding out more information from Europe. There is still a lot of stuff on Jan's board that I couldn't get, but I can now just F'req it from my hub sysop. The funny thing about all this is except for the long distance calls, or the fees for GEnie, this was all free. I really enjoy being able to call a "last stand" bbs, and be able to put my two cents in, and only have to pay for the call. And I hope things get cheaper to get, since I hope on bringing a lot of the pd and shareware stuff from Europe over here through my gateway with the hub sysop. Either way, enjoy yourselves, and have a great summer! The numbers... GEnie: Well, you have to register first, and get a subscription. call: 1-800-638-9636 Set your modem for half duplex. hit "hhh" (no enter key) at the "U#:" enter "xjm11999,genie". from there on, just answer questions. rates: $4.95 for Star Services (although they're changing the name of that), and $6.00/hr non-prime time. Plan on the $6/hr rate, since the Sinclair sections are not covered under the star services. (Neither are the games!) Computer Monthly [EE]: 1-205-655-4065 1-205-655-4059 Both numbers are 2400 baud+. Access is free from the first call, I think (sorry, it's been a while since I last logged on to check). The sysop is very friendly! Sir Clive's Castle BBS (Ottawa, Canada): 1-613-745-8838 The sysop is very friendly, and I'm appreciative that he still keeps the board running after the club disbanded. Access is free, although this is mostly a 2068 board (it does, after all, run on a 2068). Mini File Server BBS (MFSBBS): 1-408-253-2295 This is run on a C=64 for Bill's group, Slix. There is no logon name or password needed, and to leave a message to someone, just leave it as a file called to.soandso.last. Good idea to precompose your letters before hand. There is also currently a lot of information available on drive 11 (I think it's 11, it might be 10...). You might also want to encourage Steve Nichols, the sysop, to add a formal message system. Hint, hint, Steve.... Motorola Tech board: 1-708-576-7140 CATUG uses this board to exchange information. I don't know all the details about this board, so you might want to contact one of them about it. There is also a bit complex way of getting on and navigating, so I suggest getting a hold of someone who knows how to get on, or otherwise get used to a "User Validation Error, NO CARRIER" message... Jenny's Dog House: This is the board that is carrying the echoes on this side of the Atlantic. Currently, due to a bug in Jan's setup, Jan is actually polling here (because Jenny's can't call him). When it gets switched around, I have agreed to pay for the calls to Holland for the sysop. Because of this, the echo areas are only currently open to me, two other subops, and the sysop. If you are interested in calling here to get into the echo areas, please contact me, and I will ask Tim, the sysop, to set it up. This is mostly to keep the regular callers out of the echoes and jacking up the phone bill uneccessarilly. 3 nodes. I am sub-op of the Amiga section here, so that gives me a little bit of clout, obviously, with Tim... Also, the echos he's currently picking up are: QL Minerva Sinclair C QL user International C 1 other echo reserved for future expansion (there are still others to be picked up). I'm not sure "International C" is what it really is, I think it's something more like "programming", but it defenitely is QL related! Finally, there is Jan Brendenbeek's two boards, Syncnet: 011 31 35 237178 Quasar (Qbox HQ): 011 31 35 216520 Quasar is run on a QL, Syncnet on a PC type under Remote Access (made to look like Qbox). Jan is a VERY nice guy, and set me up very well over here. I was the first American to call his board, ever. Maybe the rest of America will be able to talk to him through the echoes on Jenny's Dog House.... [ Mark is now running his own BBS at (517) 655-5792, 8 bits, 1 stop bit, and no parity, and up to 2400 baud. - ED] .DW .UL QHJ Print Formatter .DO .UO By Tim Swenson The last four issues of the QHJ have beed done using Quill. Quill is a decent word processor but it has problems with large files. It is sooo slow when dealing with documents over 15 pages long. I have decided to move onto another text editor. I have ED, The Editor, and MicroEmacs. Ed is too small and editor for the task and The Editor has no text formating capability. MicroEmacs has a word wrap mode that I will give me the closest thing to a word processor. One problem with using a text editor is that they do not support various print formats (bold, underline, etc). I decided to write a text formater that will read in the text file, recognize text formating commands, and sent the appropriate commmands to the printer. Below is a SSB program to do this. Commands are entered on a line by themselves and must start in the first column of the line. Commands start with a period and are two characters long. They may be upper case or lower case (no mixing cases in one command). The commands are listed below: .PB - Page Break .DW - Start Double Width .DO - End Double Width .BD - Bold On .BO - Bold Off .LQ - NLQ On .LO - NLQ Off .UL - Underlining On .UO - Underlining Off The program automaticaly prints page numbers. The commands are set to be used on a Epson FX-80 compatable printer, like the Sinclair printer. ** QL Hacker's Printing Filter ** by Timothy Swenson OPEN #5,con_250x150a75x0_32 PAPER #5,4 : INK #5, 0 CLS #5 : PRINT #5,\\ BORDER #5,2,2 PRINT #5," QL Hacker's Journal Printer" PRINT #5," by Timothy Swenson"\\\ PRINT #5,"Please Have Printer Ready Then,"\\ PRINT #5,"Enter Name of File to List :" PRINT #5," (Enter Drive Name, ie. FLP1_)" INPUT #5,infile$ OPEN_IN #4,infile$ CLS #5 STRIP #5,4 AT #5,10,10: PRINT #5," P R I N T I N G " STRIP #5,2 OPEN #3,ser1 PRINT #3,CHR$(27);"x1"; page = 1 count = 1 REPeat loop INPUT #4,in$ IF EOF(#4) THEN EXIT loop IF in$=".pb" OR in$=".PB" THEN page_break : END REPEAT loop IF in$=".dw" OR in$=".DW" THEN PRINT #3, CHR$(14); : END REPEAT loop IF in$=".do" OR in$=".DO" THEN PRINT #3, CHR$(20); : END REPEAT loop IF in$=".bd" OR in$=".BD" THEN PRINT #3, CHR$(27);"E"; : END REPEAT loop IF in$=".bo" OR in$=".BO" THEN PRINT #3, CHR$(27);"F"; : END REPEAT loop IF in$=".lq" OR in$=".LQ" THEN PRINT #3, CHR$(27);"x1"; : END REPEAT loop IF in$=".lo" OR in$=".LO" THEN PRINT #3, CHR$(27);"x0"; : END REPEAT loop IF in$=".ul" OR in$=".UL" THEN PRINT #3, CHR$(27);"-";CHR$(1); : END REPEAT loop IF in$=".uo" OR in$=".UO" THEN PRINT #3, CHR$(27);"-";CHR$(0); : END REPEAT loop PRINT #3,in$ count = count + 1 IF count = 63 THEN footer END REPeat loop page_break CLOSE #3 CLOSE #4 DEFine PROCedure footer PRINT #3 PRINT #3," PAGE ";page PRINT #3,CHR$(12); page = page + 1 PRINT #3," " PRINT #3," " END DEFine footer DEFine PROCedure page_break FOR x = 1 TO (63-count) PRINT #3," " NEXT x footer END DEFine page_break .DW .UL QROFF Postscript Filter .DO .UO By Tim Swenson I know of a few QL users that have postscript printers at work and transfer QL documents to another word processor to format and print out on the postscript printer. For some this is time consuming. I have written a NROFF-like text to postscript text formater. It basically allows the user to input a text file and get a postscript printable version of the file. It does not do much formating beyond allowing the use of multiple fonts and font sizes. Commands are similar to those used in the QHJ print formatter. Commands are : .PB - Page Break .FT XX - Font Type (See code for supported font types) .PS XX - Change Font Size. I plan the expand the capabilities of QROFF. I first have to better understand poscript programming. Eventually I hope to make the program compatable with Unix TROFF/NROFF. How soon these features are added can depend upon interest. If a number of people can use the program, I give it higher priority in my queue. Below is the SSB source code: ** QROFF Text To Postscript Filter ** by Timothy Swenson OPEN #5,con_250x150a75x0_32 PAPER #5,0 : INK #5,4 CLS #5 : PRINT #5,\\ BORDER #5,4,2 PRINT #5," QROFF Text To Postscript Filter" PRINT #5," by Timothy Swenson"\\\ PRINT #5," (Enter Full File Names)" PRINT #5,"Enter Name of File:" INPUT #5,infile$ PRINT #5,"Enter Output File:" INPUT #5,outfile$ OPEN_IN #4,infile$ DELETE outfile$ OPEN_NEW #3,outfile$ CLS #5 STRIP #5,7 AT #5,10,10: PRINT #5," W O R K I N G " STRIP #5,2 deffont = 12 font = deffont deffontt$ = "Courier" fontt$ = deffontt$ page = 1 count = 1 curpoint = 750 lmargin = 37 PRINT #3,"/";deffontt$;" findfont ";devfont;" scalefont setfont" REPeat loop INPUT #4,in$ IF EOF(#4) THEN EXIT loop IF in$=".pb" OR in$=".PB" THEN footer : NEXT loop IF in$(1 to 3)=".ps" OR in$(1 to 3)=".PS" THEN IF LEN(in$) <= 4 THEN errer(4) temp$ = in$(5 to 6) IF temp$=" " THEN errer(4) font = ABS(temp$) IF (font < 6) OR (font > 36) THEN errer(5) PRINT #3,"/";fontt$;" findfont" PRINT #3,font;" scalefont setfont" NEXT loop END IF IF in$(1 to 3)=".ft" OR in$(1 to 3)=".FT" THEN IF LEN(in$) <= 4 THEN errer(6) temp$ = in$(5 to 6) IF temp$="CO" OR temp$="co" THEN fontt$="Courier" IF temp$="CB" OR temp$="cb" THEN fontt$= "Courier-Bold" IF temp$="CI" OR temp$="ci" THEN fontt$= "Courier-Oblique" IF temp$="CA" OR temp$="ca" THEN fontt$= "Courier-BoldOblique" IF temp$="TR" OR temp$="tr" THEN fontt$= "Times-Roman" IF temp$="TB" OR temp$="tb" THEN fontt$= "Times-Bold" IF temp$="TI" OR temp$="ti" THEN fontt$= "Times-Italic" IF temp$="TA" OR temp$="ta" THEN fontt$= "Times-BoldItalic" IF temp$="HV" OR temp$="hv" THEN fontt$= "Helvetica" IF temp$="HB" OR temp$="hb" THEN fontt$= "Helvetica-Bold" IF temp$="HO" OR temp$="ho" THEN fontt$= "Helvetica-Oblique" IF temp$="HA" OR temp$="ha" THEN fontt$= "Helvetica-BoldOblique" PRINT #3,"/";fontt$;" findfont ";font;" scalefont setfont" NEXT loop END IF PRINT #3,lmargin;" ";curpoint;" moveto" PRINT #3,"("; ** Postscript is not tolerant of ('s, )'s, or \'s. You ** must precede each one with a \. Just like the C shell. temp = "(" INSTR in$ temp = temp + ( ")" INSTR in$) temp = temp + ( "\" INSTR in$) IF temp > 0 THEN FOR x = 1 to LEN(in$) IF in$(x) = "(" THEN PRINT #3,"\("; ELSE IF in$(x) = ")" THEN PRINT #3,"\)"; ELSE IF in$(x) = "\" THEN PRINT #3,"\\"; ELSE PRINT #3,in$(x); END IF END IF END IF NEXT x ELSE PRINT #3,in$; END IF PRINT #3,") show" count = count + 1 curpoint = curpoint - font IF curpoint <= 30 THEN footer PRINT #3,"/";fontt$;" findfont ";font;" scalefont setfont" ENDIF END REPeat loop footer CLOSE #3 CLOSE #4 DEFine PROCedure errer(err_num) PRINT #5,"ERROR - Line Number: ";count IF err_num = 4 THEN PRINT " Font Size Not Found." IF err_num = 5 THEN PRINT " Font Size Not Out Of Range." IF err_num = 6 THEN PRINT " Font Type Not Found." CLOSE #3 : CLOSE #4 : CLOSE #5 : STOP END DEFine errer DEFine PROCedure footer PRINT #3,"/";deffontt$;" findfont ";deffont;" scalefont setfont" PRINT #3,"150 20 moveto" PRINT #3,"(PAGE ";page;") show" PRINT #3,"showpage" page = page + 1 curpoint = 750 END DEFine footer .DW .UL 2D Arrays in Small-C .DO .UO By Tim Swenson In a recent article in The C Users Journal, Don Lang discusses how to implement 2D arrays on C. His article covers code that when added to the original Small-C source, allows Small-C to support 2D arrays. Since the source code for the QL's Small-C compiler is not available, we could not use the code he provides. But he does discuss a not-so-elegant way of implementing 2D arrays. Since memory is really a 1D array, the computer figures out where in memory an element of an array is. This can be easily done in Small-C. Given an array of size MAX_X, and elements starting at 0, then (x,y) is equal to (( x * MAX_X ) + y). Below is a sample Small-C program that demonstrates this: /* Two Dimensional Arrays in Small-C For an array of [10][5] let MAX_X = 10 Assumptions: Arrays start at 0. For an array of size 10, range is 0..9. Way to address the cell at x,y: temp = array[(x*MAX_X)+y]; */ #define MAX_X 10 main() { int array[100]; /* 10x10 array */ int x,y; for (x = 0; x <= 9; x++) { for (y = 0; y <= 9; y++) { array[(x*MAX_X)+y] = x*y; printf("%d ",array[(x*MAX_X)+y]); } printf("\n"); } }