America Online APPLE II DEVELOPMENT FORUM CONFERENCE LOG Tuesday, November 10, 1992 10:00 p.m. Eastern Time Topic: Programming in BASIC Forum Leader: Gary Jacobson (AFL GaryJ) AFL GaryJ Welcome to the Apple II Development Forum! AFL GaryJ Tonight, our topic is "Programming in BASIC". I've asked John Graham (Mr. BASIC :) AFL GaryJ to join us this evening as our special guest. John (Airship), of course, is the AFL GaryJ author of "Tonight's Sky", and "Tonight's Sky IIGS", both of which (if I'm not mistaken) AFL GaryJ were written in compiled BASICs. AFL GaryJ Tonight's Sky IIGS was written in AC BASIC, wasn't it, John? Airship Those two, and my recent UL Graph Paper GS. Airship Ground Track is another of my favorite BASIC programs. AFL GaryJ I know you've done a few. Airship Here and there :) AFL GaryJ I know that you have had some experience in trying some of the different BASIC's AFL GaryJ available for the Apple II, and I was interested in your viewpoints on AFL GaryJ the different "brands" of BASIC that are available. Can you tell us AFL GaryJ what are some of the one's you've tried? Airship Okay... Airship AppleSoft (of course), & 6502 assembly... Airship ZBasic, TML BASIC, A/C BASIC are the ones I've worked with a LOT... Airship plus I've tinkered with Call Box, and a smidg'n of Micol Advanced BASIC. Airship Plus most versions of 8 & 16 bit Pascal, but that Airship is another story... AFL GaryJ :) AFL GaryJ What are some of the advantages/disadvantages to the one's you've tried? AFL GaryJ (In your opinion, of course :) Airship Oh gosh, where to begin... Airship Sticking to GS BASICs... Airship A/C BASIC's strength is the ease it let's you write desktop programs... Airship It's wekness is a learning curve that's a tad steep at first, but you get Airship used to it quick. Airship Micol's biggest strength is it's building on AppleSoft, which most Apple // Airship programmers are used to, plus it's just about the only BASIC that's currently Airship supported. It's drawback is that because of it's similarity to AppleSoft it Airship doesn't follow most of the conventions you'll find for BASIC outside of the Airship Apple // world. Airship How's that for starters? Airship <<< just getting my fingers warmed up! >>> Airship ZBasic is a great language for writing large programs within the relatively Airship small confines of the 8 bit platforms. The flow of control from a central Airship controlling "Main Menu" program to various modules makes writing very large Airship applications a snap. Airship I just said a few words about AC and MAB. AFL GaryJ I was going to say that you left out TML (maybe that's why AFL GaryJ I got bumped :) Airship Oh TML! Airship A neat lanuage... Airship with GREAT Promise... AFL GaryJ :D Airship too bad it never worked. Airship I actually wrote some pretty large programs in TML for a couple of years. Airship It has some pretty strange bugs though. Airship Tonight's Sky GS started as a TML program, but quickly choked. Airship There are still a few of the original TML modules in the Astronomy Forum Lib. GNO Jawaid Sounds like we need a new BASIC, if only one is supported... Airship (GNO, more on that in a bit...) AFL GaryJ Is there any support left for AC BASIC? Airship A/C is an interesting story of support. AFL GaryJ :) Airship They stopped development on BASIC ~1988... Airship ...but within two days of the release of GSOS v5.02 I got a letter from them Airship telling me how to modify the compiler to correct a minor bug it had under 5.02. AFL GaryJ Did they send you a block editor to do it with? :) Airship As it stands, the language is remarkably mature, though it does have one Airship relatively serious flaw that some programmers may run into. Airship When you close a dialog with edit fields and buttons, it doesn't dispose of Airship the memory defining those fields, so everytime you open a dialog, you loose Airship a liitle more memory. If you use a LOT of edit fields, or run a program for a Airship LONG time, it'll eventually crash. AFL GaryJ Nice :) AFL GaryJ Is there a way around the problem? Airship The limit's pretty high, several hundred edit fields at least, with programs Airship like TSGS it'll probably never be a problem. Airship The only fix I see (short of AC fixing it) is to write a little ML program Airship that'll do the job for you. AFL GaryJ Ok, I'm not sure how many BASIC programmers actually made it here tonight, but I think it's time AFL GaryJ to open things up to question and answer. AFL GaryJ (General, or otherwise) Airship The more general the better :) AFL GaryJ And, if we run out of BASIC questions, we can do off topic ones too. AFL GaryJ (Which may or may not apply to John) AFA Jay How do the basics that do desktop stuff deal with the toolbox and such? AFA Jay You can't make your own calls, right? Airship Two VERY different ways... Airship A/C BASIC handles the toolbox the way most compilers handle assembly... Airship A/C gives you access to probably 90% of the desktop environment though high Airship level commands like On Menu Gosub for menu events, On Dialog Gosub for Dialog Airship events and such... Airship Micol has much fewer high level commands, but opens up access to the entire Airship toolbox through a generic Toolbox(...) call. Airship Sooooo.... Airship General desktop programming with AC is VERY easy, doing fancy things is very Airship difficult. AFC SteveB Must be fun making a SFPMultiGet2() call from there :) AFA Jay that's scary :) AFL GaryJ Define "very difficult". Is there a provision in A/C BASIC to do toolbox callse not AFL GaryJ supported by the higher level commands? Airship Doing very advanced AppleSoft type programming with MAB is relatively simple Airship but prgramming the desktop look VERY cumbersome. Airship Outside of a few calls directly to QuickDrawII, not w/o ML. AFL GaryJ Well, to an assembly language programmer, I guess that's fair, but to a non AFL GaryJ assembly programmer, it's tough luck :) Airship For example, there's no way to use pop-up menus from A/C. Airship The commands from A/C are rich enough to really get your feet wet on how to Airship manage designing the elements of a desktop program, event loops, etc. It's a Airship GREAT foundation to move up from to begin genuine toolbox programming. AFL GaryJ You mentioned that you have used Pascal (and other high-level languages? Can't remember). Do you AFL GaryJ see any advantage to using BASIC these days? Or how do you compare your AFL GaryJ experience with the other languages you've tried to your use of IIGS BASICs? Airship In hindsight, BASIC was a great language to have fun with and learn. I still Airship use it a LOT when I have to develop code in a relatively short period of time. Airship What I found as my programs grew in size and complexity, that in order to make Airship them maintainable, my programming style approached that of Pascal, Airship which is one reason I'm porting my major programs over to Pascal, but BASIC Airship still plays an important role in prototyping an idea, then as the code evoloves Airship an matures I can clean it up, and organize it in a very well structred manner. Airship But it doesn't force me to do that from the outset when some of my ideas Airship haven't gelled yet. And that's very important when I write code for work. Airship However, by falling into some of the problems of BASIC, you really appreciate Airship how and why Pascal, C, and the like, are organized the way they are. AFL GaryJ Yes, I understand what you mean. Airship What I hope we'll see in the future is a BASIC from the ByteWorks, Airship which I actually think is our last hope for a really good, supported Airship implementation of BASIC on the GS. AFL GaryJ Mike has talked about it, but always as a "maybe" type of product. Airship Yeah, I think he's leary of some of the extensions he'll have to add to Airship interface BASIC to the toolbox properly (new variable types), and payback. AFL GaryJ I'm concerned that he might be too late, however, as many people, like you, have AFL GaryJ already turned to other high-level languages (like C and Pascal) because of the AFL GaryJ lack of well supported BASICs for the IIGS. AFL GaryJ (In order to get more "power" for their program) Airship In fact, MAB may be the only compiled basic available for Apple //s at all. Airship The last place selling ZBasic and A/C that I knew of was Programs Plus. AFL GaryJ Currently, I believe that is the case. AFL GaryJ I was wondering if anyone could still purchase A/C BASIC. Airship I'm going to look around and find out. I feel it's a fantastic training Airship language for the GS, and the ONLY ANSI standard BASIC for the Apple //. Airship I've ported code directly from my GS to PC's and Macs with no real problems. AFL GaryJ That's interesting. Airship In fact, in college my thesis advisors had no idea I was working on an Apple // Airship until I gave them a demo, I loved the looks on their faces! AFL GaryJ :) AFL GaryJ That would be something to see :) GNO Jawaid Heh :) Airship They were PC fanatics. Plus I ported a lot of one Prof's cherished Fortran II Airship code over to the GS. He was really interested until he saw what it was running Airship on. GNO Jawaid There's a lot of IIism in the world. :) Airship :) I still snicker when I think about it. He loved the color plots I was Airship getting off my IW-II. GNO Jawaid And we're not II-users, we're "Computationally underprivileged". :) GNO Jawaid So what do y'all think about BASICs that allow all tool calls direct? GNO Jawaid BASIC is supposed to be a high level language.. it doesn't mesh with my GNO Jawaid conceptions of BASIC. AFL GaryJ Can you have the best of both worlds, Jawaid? AFL GaryJ Like, the ability to do any toolcall (somehow), and have the high-level commands AFL GaryJ too? GNO Jawaid Gary- rarely. :) Maybe in this case, though. Airship A/C would be ideal for that if they only had MAB's Toolbox call. Airship The problem with that is, by the time you figure some of the cryptic calls out Airship you might as well have learned Pascal. Airship The guy that wrote Basic Designer found a whole bunch of undocumented Airship features in A/C that clearly shows they were planning a lot more development Airship on the language. GNO Jawaid Thanks; I'm just curious, from a language-design standpoint, how to merge GNO Jawaid the two alien concepts (very high level and direct system call access) GNO Jawaid The issue applies to other very high level languages such as Lisp and Scheme. AFL GaryJ I think if you had a toolbox call of some sort (that would allow ANY toolbox call to be made - any AFL GaryJ legal one, that is :) it would suffice for the direct system call access for programmers AFL GaryJ who prefer to use the toolbox directly. Otherwise, people could use the AFL GaryJ high level commands when it suited them. Airship MAB does that pretty well, but it just doesn't offer much in the way of high Airship level control. You have to control too much of the desktop operation using Airship generic Toolbox calls. Makes for a real mess. GNO Jawaid I'll have to see if I have any MicroSoft BASIC (Mac version) code around GNO Jawaid from my old days, to recall how they did it. Airship On the other hand, in A/C I had to right my own scroll bar routine. Yeck! GNO Jawaid This is the reason I've never started on a BASIC; it's easy to do the GNO Jawaid basic (ack) stuff, but the toolbox interface and design is daunting. Airship That's the problem I had when I first bought my GS, the only language I could Airship find was TML Pascal. I thought I was going to die! But now I think I'm ready Airship for it. AFL GaryJ Yes (Jawaid), I think it takes a lot of thought. I liked some of the A/C BASIC AFL GaryJ implementations mentioned. It would be kind of fun to think of AFL GaryJ BASIC ways to do things. (Like the On Menu GOSUB type of thing) GNO Jawaid hmm.. yeah. Airship One neat command in A/C is On Timer Gosub. Airship I use it to control data acquisition rates of up to ~100 Hz. Airship Just don't move the mouse :) GNO Jawaid My major problem is you have to add pointer support to BASIC, which really GNO Jawaid flogs the whole BASIC concept :) AFL GaryJ True Airship It is nice having at least one ANSI dialect available. It helped a lot in Grad Airship school. AFL GaryJ It is important in todays world. AFL GaryJ (ANSI) GNO Jawaid I'm thinking along the lines of something 99% applesoft compatible. GNO Jawaid So you can pull up your old old basic programs, compile them on the IIgs, GNO Jawaid and they automatically use SHR and stuff like that. AFL GaryJ That would be neat. Airship Someone ULed a demo(?) of a program to convert AppleSoft to TML BASIC. Airship Gosh I hate to think of how much money I spent on that company. AFL GaryJ A few other feel that way, as well, I'm sure :) Airship Some of the more interesting bugs were things like Peek returning negative Airship values... AFL GaryJ :) GNO Jawaid heh :) Airship ...but only if you Peeked an integer, worked fine with reals. AFL GaryJ Maybe that was a "feature" :) Airship Ahah! That's it. Airship As programs got longer, program lines had to get shorter. Airship Yep, thanks again for having me by. T'was fun! G'Nite! AFL GaryJ Yeah, it was fun. AFL GaryJ Thanks, John! AFL GaryJ Goodnight.