--------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: CDS00000 Date: 09/21/95 From: STEVE LEGG Time: 07:38pm \/To: LAWRENCE GORDON (Read 3 times) Subj: more declarations? Hi Lawrence! LG>SL> How many of you actually leave the full array/variable declaration LG>SL> requirement on _ALL_ the time? Under what conditions might you turn t LG>SL> off? It seems to be a bit of a pain to keep all that stuff in line or LG>SL> what many of you will consider to be a trivial program. LG>I normally don't do it, but I'm normally writing programs for myself. LG>It has tremendous value, however, when debugging a function or when others LG>have to maintain your code because it =forces= structured programming LG>techniques. Thanks for your reply on this one. I've begun to be pretty careful about what I write, even if it is only for myself. I find it so much easier to go back later if I need to. And you're right about the discipline required. I like the fact that with PowerBASIC I have a choice. I did some Pascal programming many years ago, and was annoyed then by the fact that I couldn't really just throw something together in a hurry if I needed to. But BASIC wasn't really as neat and tidy as I wanted to be either. Now it is ... best of all options! A.T.B! -= Steve Legg -=- RelayNet ->CRS =- -= Oshawa, Ontario CANADA -=- steve.legg@canrem.com =- --- * OLXWin 1.00a * grep..grep..grep... (Frog w/UNIX stuck in throat) --- QScan/PCB v1.17b / 01-0348 * Origin: FidoNet: CRS Online, Toronto, Ontario (1:229/15) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: CDS00001 Date: 09/20/95 From: JOE CLARK Time: 08:53am \/To: RODERICK RIENSCHE (Read 3 times) Subj: Comm.. Argh! RR> Here's the problem.. Using the following code on my system (which o RR> has a plain old 14.4k modem on COM2), output works--i.e. I type ATH1 RR> the phone goes off-hook--but I don't get any input from the modem (i RR> I don't see the ATH1 and the subsequent OK). RR> RR> Note, If I skip the "SetComAddress", and just use "OPEN COM2:..." bo RR> input and output work beautifully.. RR> print hex$(GetComAddress(2)), hex$(GetComAddress(1)) RR> SetComAddress 1, &h2f8 RR> RR> open "com1:38400,N,8,1" as #1 len = 1024 I can see a number of things. First, I work in QuickBASIC, so my solution may not be exactly the same. 1: COM1 address is &H3F8 COM2 is &H2F8 2: I don't know about PowerBASIC, but the OPEN COM statement in QB uses BIOS routines, and BIOS routines only handle up to the fastest a serial port can go (regardless of the modem speed) which is 19200. 3: Try this: open "com1:19200,N,8,1,RB1024" for BINARY as #1 The RB1024 sets the receive buffer to 1024 bytes. The len= has no effect on communications routines. Hope this helps! Joe Clark --- GEcho 1.00 * Origin: The PowerSoft Connection -=- 206-589-8429 (1:138/288) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: CDS00002 Date: 09/21/95 From: THORNE SMITH Time: 11:00pm \/To: ALL (Read 3 times) Subj: PB3.2 I'm seeing people talking about PB 3.2 being out and am wondering why I haven't received an announcement of it or an invitation to upgrade for $x amount of dollars? Is it actually out for sale/upgrade or is it in beta? I think I've received a invitation to upgrade to every minor upgrade sense I bought 3.0, but haven't seen much need in upgrading so far. if it supports 16550 chips now then that would probably be enough to get me to upgrade. Any info would be appreciated from anyone! Thorne --- Platinum Xpress/Wildcat! v1.0N * Origin: FIDO THOrne...'s Castle (214) 422-1589 Plano,TX (1:124/6522) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: CDS00003 Date: 09/20/95 From: JAMSHID KHOSHRANGI Time: 01:42pm \/To: CHRIS ADAMS (Read 3 times) Subj: About ARDAF151.BAS CA> JK> What follows is a four message POSTIT!'ed .ZIP. I had to .ZIP the CA> JK> file because the source code includes codes that choke mailers. ... CA>Jamshid, I just wanted to take a minute and thank you for the amount of CA>high-quality code you have released. You're really providing a lot of CA>valuable material. Chris: It's a comment like yours above that makes writing publicly availble code like ARDAF and LANSI worthwhile and rewarding in and of itself. Jamshid --- Maximus/2 2.01wb * Origin: Sound Stage BBS - Live Via Satellite - (604)944-6476 (1:153/7070) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: CDS00004 Date: 09/21/95 From: JAMSHID KHOSHRANGI Time: 08:09am \/To: STEVE LEGG (Read 3 times) Subj: more declarations? Steve! SL>Oh well. I've learned something from it, and there's something to be SL>said for every lesson, however learned. :) I don't know how many of the things I know are the result of experimentation, pluck, and sheer stupidity on my part. SL>I understand. On your recommendation some months ago, I did purchase a SL>copy of Steve McConnell's book "Code Complete". I've been going through SL>it, a little at a time, and trying to put some of the things I've SL>learned there into practice. I struggled through some of the SL>concepts re. information hiding, etc., but I've learned a lot. It's SL>been a good exercise, and I think I've really improved some of my code as SL>a result. McConnel's book is the best there is, in my opinion. Every time I read it, I pick up something new. SL>Anyway, I've finally gotten the nerve to try some of the SL>other things you suggested re. declaring everything and giving the SL>compiler an opportunity to catch "spelling problems", and I think there's SL>been some benefit there too. Spelling errors can kill a BASIC program, if the default behavior of automatic variable declaration is not used wisely. SL>That said, I've gotten used to the idea of trying to make sure SL>anyone else who might look at what I've done can understand what I SL>was up to. To this end, declaring even the default type/scope seems to SL>enhance readability for anyone who understands what it will do. I tend to agree with you. The default scope/life in PowerBASIC is PRIVATE LOCAL, but, heh, if you're gonna hafta declare data types anyway, why not have a compiler option that forces scope/life declarations. (I say "life" to mean LOCAL, SHARED, or STATIC.) JK>You cannot, with declaration mode on, have two variables WITHIN THE SAME JK>SCOPE with the same base name. This is how C programmers have always JK>had it. I prefer DIM a AS STRING and SUB MySub (A AS INTEGER, etc.) SL>Me too now! When I'm doing this I can usually find room to fit a SL>concise description of the variable's use within 80 characters. A variable's name should reflect its semantic purpose. If we can't find a good name for our variable, often times it is because we are not sure ourselves exactly why the variable is there. By forcing declarations, we are forced to think about what we call our variables. Death to all "temp"s. JK>The old-style suffixes are very nasty to parse with preprocessors. SL>What does a preprocessor do, and why might you use one? In my case, I'm programming a Fermat to PowerBASIC preprocessor. (Fermat is an object oriented superset of BASIC.) It is necessary, as I pass the code, that I know what each token is in a given scope. Syntax can only be checked if we know the purpose of each token. Consider the following chunk of Fermat code: CLASS MyClass Attr1 AS INTEGER Sub1 AS SUB (x AS INTEGER, y AS INTEGER) END CLASS DIM this AS MyClass This.Sub1 1, 2 Okay... How do we know, as we preprocess, that the statement "This.Sub1 1, 2" is legal? To get to that line, we have already passed two declarations. The CLASS and DIM are declarations of the tokens MyClass and This. We know that This is of class MyClass, and that MyClass has the method Sub1, and that Sub1 accepts two integer parameters. The preprocess then spits out the following PowerBASIC code: TYPE MyClass Attr1 AS INTEGER END TYPE DECLARE SUB MyClass__Sub1 (x AS INTEGER, y AS INTEGER) DIM This AS MyClass CALL MyClass__DIM (This) MyClass__Sub1 This, 1, 1 The job of the Fermat preprocess becomes considerably less if we force declarations and don't allow suffixes like $, %, &, etc. JK>Constants are preceded by %, not the type, and may only be numeric. I'd JK>like to see string constants. TRUE and %TRUE are not one and the same. JK>%TRUE is a global constant, whereas TRUE is an identifier that may be of SL>Ahh! That's the distinction. I've been working with Scriptmaker SL>lately, a BASIC implementation for Windows that comes with Norton SL>Desktop for Windows. It uses the Microsoft CONST declaration for all its SL>constants, and a constant takes the type of its first assigned value. I SL>think I like that better. CONSTs and %s aren't strictly the same in QB and PB. I don't know which I like better, myself, but I do prefer to see in the code a clear %XXXX so that I know it cannot be altered. QB style constants look just like variables until compile time. SL>This "recognition" is the purpose for some of the variable naming SL>conventions (notably Hungarian) as well isn't it? I hate Hungarian notation from an aesthetic point of view, but it does the job of the $, %, @, !, & symbols well enough, I suppose. I personally feel that variables should be so aptly named as to eliminate the need for reminders. SL>Thanks for your comments Jamshid! A little inspiration goes a long SL>way. All the best. All the best to you, too. Jamshid --- Maximus/2 2.01wb * Origin: Sound Stage BBS - Live Via Satellite - (604)944-6476 (1:153/7070) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: CDS00005 Date: 09/21/95 From: JAMSHID KHOSHRANGI Time: 08:18am \/To: DAVE NAVARRO (Read 3 times) Subj: argh! Dear Dave and PowerBASIC tech staff: Over the last months I have been developing a pattern matching language known as ['LPM'$(tm). The code had been debugged and certified and was running without error under PB 3.1. A total of about $25,000 development time was put into this 5,000 source line utility. The code compiles under PB 3.2 without a hitch, but does not produce correct results when executed, and produces stack heap corrupt errors on every run, unless I remove an entire section of code. Since it compiles under 3.1, I suspect it SHOULD compile under 3.2. It compiles, but it doesn't run properly, and the error seems to be in PB 3.2's memory management, not in my code. Variables have unpredictable values at critical points in the code. Running under 3.1 produces perfect results. I cannot go back to 3.1 for the sake of other aspects of the project that will benefit from the features found in 3.2, so how should I proceed, since it is unlikely that I can submit 5,000 lines of state-of-the-art proprietary code to the PowerBASIC tech department for scrutiny. Please let me know how I should proceed. If it comes down to it, I'm going to have to rewrite 5,000 lines of code at the cost of another $25,000 of my time. And all for a $19.95 upgrade. Jamshid --- Maximus/2 2.01wb * Origin: Sound Stage BBS - Live Via Satellite - (604)944-6476 (1:153/7070) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: CDS00006 Date: 09/19/95 From: DAVE NAVARRO Time: 10:34am \/To: ERIC SCHONNING (Read 3 times) Subj: Re: Interrupt Driven Comm ES>btw, just why is supporting more than 4 comm ports ES>simultaneously such a hassle? it seems like if we give PB the base ES>address and IRQ# it should just treat it like com1-com4; instead of ES>reading bios for base address it just uses the value we pass to it. ES>just wondering as you said it would be a giant hassle. Because the current ISR would have to be re-written and expanded to handle the additional overhead. It's a possibility, but since only a couple of people are asking for it, the developers are working on more requested features. --Dave --- * QMPro 1.53 * Let's face it, I'm right and you're not convinced! --- WILDMAIL!/WC v4.12 * Origin: Toast House * (314) 994-0312 * (1:100/560.0) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: CDS00007 Date: 09/19/95 From: DAVE NAVARRO Time: 10:34am \/To: CHRIS ADAMS (Read 3 times) Subj: Linking OBJ files... 1/3 CA>Did you look at the ASM routines I sent you? I'm still working on it (in CA>my copious spare time), but I'm not getting anywhere... ASM routines? Which ones are these? --Dave --- * QMPro 1.53 * Does the Big Bang make a sound if no one hears it? --- WILDMAIL!/WC v4.12 * Origin: Toast House * (314) 994-0312 * (1:100/560.0) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: CDS00008 Date: 09/19/95 From: DAVE NAVARRO Time: 10:35am \/To: PEDRO JARAMILLO (Read 3 times) Subj: Re: pbTOOLS PJ> DN> I have released PBTools:Classic, a shareware library (the latest releas PJ> DN> is 1.33). And am finishing up PBTools:Professional, a commercial PJ> DN> library. PJ>Are they compatible with PowerBasic 2.01a? No, they take advantage of features only available in PowerBASIC 3.x. --Dave --- * QMPro 1.53 * Crime DOES pay! Ask any priest or politition! --- WILDMAIL!/WC v4.12 * Origin: Toast House * (314) 994-0312 * (1:100/560.0) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: CDS00009 Date: 09/19/95 From: DAVE NAVARRO Time: 10:38am \/To: SAUL LEVY (Read 3 times) Subj: PB 3.2 statement SL>But how many is "many?" .00005%? 1%? 5%? SL>You didn't answer my question! =8-) What was the original question? --Dave --- * QMPro 1.53 * Alumnus of the Institute for the Sexually Gifted. --- WILDMAIL!/WC v4.12 * Origin: Toast House * (314) 994-0312 * (1:100/560.0)