--------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F3L00000 Date: 03/13/98 From: MARKUS TREINEN Time: 03:35pm \/To: DAVID ROTHSCHILD (Read 2 times) Subj: Individual bits ---- *David Rothschild* mute am 08.03.98 zum Thema ---- *"Individual bits"* folgendes blubbern: ;) DR> How do can I read the individual bits that are inside a byte? You have to do Bit-Manipulations on the Byte: If you want to check, if the 3rd Bit is set, do following: BitToCheck% = 3 'Bit to Check TestByte% = 56 'Byte to Test IF (TestByte% AND 2 ^ BitToCheck%) <> 0 THEN PRINT "Bit Set" ELSE PRINT "Bit NOT Set" END IF The only thing you have to do, is to insert the number of the Bit you want to check. If you got the Byte in a String, then you have to VAL it to an Integer. But caution: +---+---+---+---+---+---+---+---+ ! 7 ! 6 ! 5 ! 4 ! 3 ! 2 ! 1 ! 0 ! +---+---+---+---+---+---+---+---+ The first Bit is Bit Number 0. So if you want to Check the FIRST Bit, set BitToCheck% = 0. If you want to Check the eighth Bit, set BitToCheck% = 7! Thiz Mail Copyright (C)1998 by Markus Treinen All Rights Reserved. --- RiziBizi * Origin: Carl Ranseier ist tot... (2:2452/455.8) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F3L00001 Date: 03/15/98 From: BUCKY CARR Time: 09:12am \/To: DAVID WILLIAMS (Read 2 times) Subj: Old Folks -> Are you talking in high school? I believe few folks get out of high -> school with well honed logic skills. DW> Oh no! University. Years and years of it! Okay, that I agree with. DW> like programming in BASIC. In assembler, on the other hand, things are DW> much more mechanical, like driving a car. If you drive at a wall, you DW> will crash. You have to think in a very simplistic and mechanical way. I like your analogy. However since there are BASIC to ASM compilers, there has to be some relationship there. My take on the difference is that BASIC does a lot for you with each simple word. Each simple word in BASIC may require a number of ASM steps to get the same message across. BASIC saves the steps and bloats the code. For example, if I can, I try to write stuff in BASIC, then convert it to ASM. The logic process follows. Oh well. Agreed we've talked this to death. --- PPoint 2.00 * Origin: Vanishing Point (1:15/7.1) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F3L00002 Date: 03/15/98 From: BUCKY CARR Time: 09:21am \/To: BOB LOTSPEICH (Read 2 times) Subj: Old Folks On (15 Mar 98) Bob Lotspeich wrote to Rick Pedley... BL> If I hit tricky aspects in my code, I have been known to make some BL> simple REMs for future reference, but even that is not a hard and BL> fast rule in my programming. Are you confessing to documenting your code? You can be banished from this echo forever if anyone finds out you do that. --- PPoint 2.00 * Origin: Vanishing Point (1:15/7.1) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F3L00003 Date: 03/16/98 From: BOB LOTSPEICH Time: 12:15pm \/To: BUCKY CARR (Read 2 times) Subj: Old Folks | Quoting from a message by Bucky Carr | To Bob Lotspeich | About - Old Folks BC> Are you confessing to documenting your code? You can be banished from BC> this echo forever if anyone finds out you do that. Shhhh! I know... 8-) --- Blue Wave/386 v2.30 * Origin: The Circle Circus * Dale City, VA * 703-730-3115 (1:265/124) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F3L00004 Date: 03/16/98 From: DAVID WILLIAMS Time: 09:39am \/To: KURT KUZBA (Read 2 times) Subj: Old Folks -> DavidWilliams.FontyTowers -> and -> DavidWilliams.CapCanada -> are separate variables occupying contiguous space. Surely, that should be "FawltyTowers". :) dow --- PCBoard (R) v15.3 (OS/2) 5 * Origin: FidoNet: CAP/CANADA Support BBS : 416 287-0234 (1:250/710) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F3L00005 Date: 03/16/98 From: DAVID WILLIAMS Time: 02:58pm \/To: THOMAS MATYSIK (Read 2 times) Subj: Flowchart programming -> They have. There is a shareware program available called "GAP" for -> "Graphically Assisted Programming", which is based on flowcharts. It -> is rather simple, though, as it has only a few commands like DO:LOOP, -> FOR:NEXT, PRINT, INPUT and it has only two data types, string and -> integer (might also be floating point). Runs under Windows. Hmmm.... My thing was better than that! It could handle *any* BASIC command - essentially because it was running "inside" BASIC - except for some of the flow-control ones such as GOTO. It could do conditional branches, i.e. IFs, and loops, but only the WHILE type. After all, any loop can be written as a WHILE, if you want! Loops and branches could be nested to some extent - up to a total of four deep, I seem to remember. Any variable-type that could be handled by the BASIC under which it ran - i.e. integers, real numbers and strings - could be handled. Real old-timers may remember a magazine called "Compute!", which was very popular in the 1980s, but which has gone out of business since. I wrote an article about this flowchart interpreter, which Compute! published in about 1982 or '83. The editors made the comment that it was one of the strangest things they had ever seen! I don't know if any back-numbers are still available from that period. It sounds like GAP is a step backward. Still, at least it is keeping the concept alive. dow --- PCBoard (R) v15.3 (OS/2) 5 * Origin: FidoNet: CAP/CANADA Support BBS : 416 287-0234 (1:250/710) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F3L00006 Date: 03/15/98 From: BILL WHITE Time: 03:51pm \/To: CHRIS GUNN (Read 2 times) Subj: Re: Printing a .bin file CG> BW> This does not work for me. Remember, I said the CG> BW> file was a binary file, not a text file. It was CG> BW> created by telling WordPerfect to print to disk instead CG> BW> of paper and the file will print properly in DOS using: CG> If you are dealing with a WordPerfect "Print to disk" file, CG> you need to use the CG> equivalant of the DOS "TYPE filename > PRN" command. You also need CG> to ensure the printer is initialized the way Word Perfect expects. CG> If the WP file you are working with does not match your CG> printer, that will make a mess of things. CG> You'll need to open the file for BINARY, GET chunks of it, CG> and send them as binary to the printer port. Don't forget CG> your error traps so you don't overflow the printer's buffer. You did it - or at least put me on the right track. I was convinced my WordPerfect "print to disk" file was correct because PRINT filename in DOS would print it properly. And even QB's SHELL "PRINT filename" was working when I returned to DOS. SHELL "Copy filename PRN:" would work, but it insisted on giving a form feed, even tho I had taken it out of the file with Norton's disk editor. The final SUB looks like this: -------------------------8<------------------------ SHELL "type printer.bin > PRN:" FOR i = 1 TO 48 LPRINT " " NEXT i FOR i = 1 TO 10 LPRINT "Now is the time", i NEXT i LPRINT CHR$(12) -------------------------8<------------------------ Without that first FOR/NEXT loop, the second one was being printed starting at I=6. Much trial and error found the figure 48 for the first loop - any more and I've got blank lines. And something has to be printed, LPRINT "" won't do it. I don't know why this is necessary - and SLEEP didn't help. Anyway, it works like I wanted it to, so THANKS! FIDO: Bill White @ 1:135/110 (Miami) InterNet: bill.white@110.sunshine.com * SLMR 2.1a * I'm not crazy - the voices told me so! --- Maximus 2.01wb * Origin: Miami Amateur Computer Club BBS/USR Courier V.E (1:135/110) --------------- FIDO MESSAGE AREA==> TOPIC: 125 QUICK BASIC Ref: F3L00007 Date: 03/16/98 From: BILL WHITE Time: 12:51am \/To: CHRIS GUNN (Read 2 times) Subj: Re: Old Folks CG> Flow charting is also very important. If you can't organize and CG> diagram chunks of a program on paper, you are going to have CG> problems trying to organize the source code. Those nice CG> little plastic templates with diamonds and squares should CG> be one of the first tools purchased towards a programming CG> career. Unfortunately, when I was a teen I bought a well-used typewriter and started typing on my own, no lessons, no touch type. 55+ years later I'm still typing that way. I can do pretty good, but I wish I'd learned to type properly. A similar situation pertains to my programming. My roommate was assigned to the maintenance crew of a main frame. I was very interested in it and he gave me a list of the machine language commands. I was writing minor programs for it before I ever saw it - and never heard of flowcharts. Eventually, he sneaked me into the building on a Saturday and I got to play with it - and run my programs. I was so taken with the machine I applied for membership in that group. I had to agree to remain with the "firm" an extra year. These were delicate negotiations since I wasn't supposed to know the thing existed. When I was properly introduced to the machine, I had to Oh and Ah at the proper places like I'd never seen it before. As you've probably noted, even after almost 50 years, I'm still circumspect when I talk about it. I really don't know if the proper training would have helped: I am the type who forges ahead and only reads the directions when all else fails! But yes, I would recommend learning flowcharting (and touch typing). I only do it when I can't find the end of this piece of spaghetti! FIDO: Bill White @ 1:135/110 (Miami) InterNet: bill.white@110.sunshine.com * SLMR 2.1a * If you cannot measure output, then you measure input! --- Maximus 2.01wb * Origin: Miami Amateur Computer Club BBS/USR Courier V.E (1:135/110)