America Online APPLE II DEVELOPMENT FORUM CONFERENCE LOG Tuesday, August 21, 1990 10:00 p.m. Eastern Time Topic: BASIC Programming Forum Leader: Dave Sugar (AFL Dyfet) AFL Dyfet Okay, good evening and welcome to the Apple II Development Forum. Tonight our AFL Dyfet topic centers on programming in Basic, and we will begin shortly... AFL Dyfet Okay, we will be using protocol starting now. If you wish to ask a question, AFL Dyfet enter a '?' on a line by itself, and if you wish to comment on the current AFL Dyfet question being discussed, enter a '!' on a line by itself. The floor is now AFL Dyfet open for questions. AFL Dyfet Go ahead, AFC TAP, you have the floor now. AFC TAP thanks... simple one... AFC TAP will th new basic system fix the bug in the chain code?? AFC TAP ga AFL Dyfet Go ahead Dave... Dave Lyons What bug? I thought that was fixed in 1.4, but maybe my brain is toast. AFC TAP ok, I run 1.3 and it crashes on accasion during chains... AFA Gary J I think Dave is correct. Dave Lyons Crashes?? Ouch. Are you talking about a bug that's been discussed Dave Lyons in A2-Central a lot, or something else? AFL Dyfet That old bug was squashed in 1.4 :)...I recall a work-around I had to do for it AFL Dyfet in the old days when I was programming UBBS :)...Okay, GA Rosen... RosenNeil isnt 1.3 the one that had the bug with BLOAD and BSAVE..if so trash it! AFC TAP I heard it was the variable squashing or somethiong like that... Dave Lyons (Yes, 1.3 had a bad BLOAD. But that's the only thing fixed from 1.3 to 1.4; the CHAIN stuff Dave Lyons should be okay in 1.3) AFC TAP thanks... AFL Dyfet Go ahead Joey AFA JoeyS Yeah... I've got the patch laying around somewhere, Scott; the BI that comes w/ AFA JoeyS EBBS has the patch installed... compare it to a normal BASIC.SYSTEM to see AFA JoeyS where the changes are... :) GA Dave Lyons (BTW, P8 Technical Note #24 has the revision history for BASIC.SYSTEM.) Dave Lyons (done) AFC TAP thanks (ga) AFL Dyfet Okay, I believe Tamira has the next question/comment and the floor now...GA Tamira This has nothing to do with ADV but since all my friends are here I thought I would share some good Tamira news before I go....As of Sept 1st you are looking at the new Head Innkeeper at the Red Dragon Inn and Tamira the writer for Lifestyles for the Phantasy Guild.....an kinda proud of it BTW :D RosenNeil Congratulations..... A2GS Congrats Tam!! AFL Dyfet Great!! Nuzz good news Tamira, and well deserved Tamira BLUSH thanx all Tamira I was just BURSTING with the news and had to tell SOMEONE!!! AFA Gary J That's good news, Tamira! Arc42 I've got a big Shrinkit problem, guys Arc42 I only have one disk drive, and the Shrunk file won't fit on the disk with Arc42 the unshrunk file. Am I doomed? AFA JoeyS (unless you have a RAM disk large enough to hold the shrunk file, yes, Arc, :( AFL Dyfet Okay, Joey, go ahead... AFA JoeyS Okay, here's a fun one: I'd like to write a configuration program that defines AFA JoeyS a series of variables in memory. These variables, unfortunately, AREN'T nice AFA JoeyS and tidy (i.e. array format) -- just different names all over. What's the AFA JoeyS best way to do this?? I was thinking of storing tokenized assignment strings AFA JoeyS in a datafile and poking them into the middle of the basic program, but that AFA JoeyS seems awfully messy... any other ideas?? AFA JoeyS GA AFA JoeyS LOL, no one has an answer to my question? AFL Dyfet You are trying to initialize an array in memory, Joey? You could try to locate AFL Dyfet it in memory by the descriptor table and then bload what you need into it... AFA JoeyS No, it's got nothing to do with arrays. I've got an arbitrary set of variable AFA JoeyS names (OP$, SY$, G0$, etc) that I'd like to assign with a configure program, AFA JoeyS but I don't want to have a huge set of OP$=I$:RETURN lines thrown into the code AFA JoeyS GA AFL Dyfet There is also the VAR filetype, which could be used to hold inital var values. AFA JoeyS Right; the results of the variable assignments will be going into a VAR file. AFL Dyfet Okay...um, what exactly is the problem you are having then...I think I've AFL Dyfet missed something in your comments... AFA JoeyS Okay. I have a set of 50 or so variables that I'd like to assign in a BAS AFA JoeyS program. I COULD do something like... AFA JoeyS : ON GOSUB 1000,1100,1200,1300, ....... AFA JoeyS 1000 INPUT "Value of Var #1",G0$:RETURN AFA JoeyS And do that 50 times, but I'd rather have one general-purpose subroutine to AFA JoeyS retrieve the value of the variable... make sense? AFL Dyfet OH!! I see!! I was looking at the wrong end of the problem! AFL Dyfet GA AFC TAP... AFC TAP Joe, have you thought about using an array top build the arbitrary list AFC TAP and then pass the array to a small ML poster routine which will stuff the AFC TAP values into memeory and then you can save the VARS... AFC TAP use the varname in the array as a prompt if you want... AFC TAP ga AFA JoeyS Ummm... no, I hadn't thought of that... but it'd work... 'cept how do you AFA JoeyS retrieve the variable address unless the varname was passed by the BASIC host? AFA JoeyS (GA) AFC TAP you should know ahead of time all of the varnames right?, so pass a array AFC TAP with the varnames in a string and the value as a number, the poster will AFC TAP just go thru and locate each varname and poke the correct value... AFC TAP works for any arbitary list of names... AFC TAP ga AFA JoeyS Oh... okay, I see what you're saying... yeah, that'd work, okay... thanks, AFA JoeyS Scott :) {S GA} AFL Dyfet Any further comments? AFA JoeyS (no one EVER likes my questions, :) Nuzz but we like YOU AFA JoeyS Awww... Thanks, LOL AFL Dyfet Okay, who has the next question? AFP TimB What's the word on TML Basic? Matt DTS The word in the press release was that TML will keep selling it until Complete has a new version. AFL Dyfet TML Basic has been aquired by Complete Technology, as has TML Pascal. They AFL Dyfet are planning to fix it up a lot before re-releasing it as Complete Basic. AFP TimB Who owns Complete? VC? AFL Dyfet Yes. AFA JoeyS Yeah AFA Gary J (Hmmmm I didn't notice that VCooper left). AFA JoeyS (he left right when I came in... coincidence?) A2GS VC? AFP TimB VC = Vince Cooper. AFP TimB TML has left a real sour taste in MY mouth. A2GS New company? AFL Dyfet TML had no interest in what they were doing in the IIgs market, period. AFP TimB Least I feel Mike Westerfield has some commitment to excellence. AFL Dyfet We will be discussing TML Pascal (Complete Pascal) with Vince Cooper next week, AFL Dyfet and that would be a good opertunity to find out about TML Basic as well... AFL Dyfet Okay, who has the next question? AFL Dyfet GA Gary... AFA Gary J I don't remember if I asked this here before, I posted it over in Byteworks AFA Gary J a couple of months ago.... and I think Mike lost track of it. AFA Gary J I'm writing an assembly program (sorry, not BASIC :) that must be leaving AFA Gary J something amiss when it quits. (Yes, I do remember asking it here, but I still AFA Gary J don't know the reason :). Anyway, after running my program, it causes the AFA Gary J ORCA editor to produce an "Invalid Text Data" error when trying to edit a AFA Gary J source file (ANY source file). It hangs at that point, and I have to re-boot. AFA Gary J The trouble is that it doesn't always go away on a warm re-boot. I have to AFA Gary J power off. AFA Gary J Does anyone know what could cause such a mess?? :) AFL Dyfet GA Dave... Dave Lyons Gary, it sounds like you're trashing memory semi-randomly somewhere. The invalid text Dave Lyons data message could mean you're trashing the fast-file image of some file in the fastfile Dave Lyons system. Dave Lyons The reason you would still Dave Lyons have problems after an Apple-Ctrl-Reset is if you trashed some actual Memory Manager data structures. AFA Gary J That's what I thought too (that's why I was happy to get Big Brother to test AFA Gary J the situation). Dave Lyons The Memory Manager doesn't *really* get restarted on that kind of boot--remember Dave Lyons for example that /RAM5 uses the memory manager & lives across Resets. AFA Gary J A Memory Manager data structure? Like a trashed handle? Dave Lyons So BB didn't find any damage? (If you always trash *used* memory, BB never helps!) Dave Lyons Yeah, a trashed handle...actually a trashed "handle chain"--each handle points (currently) to a 20- Dave Lyons byte structure called (at least by me!) a Master Pointer Record, which includes links to the Dave Lyons previous and next handles in the chain. AFA Gary J That's interesting. I hadn't thought about the Memory Mangager re-start AFA Gary J business. That tells me where I need to look, in fact I can probably guess AFA Gary J the problem already! Thanks Dave. Dave Lyons If you're ever *failing* to dereference a handle, and storing stuff through it as if it Dave Lyons were a pointer, that's a *really* good way to have hard-to-find bugs (hard to find because you crash Dave Lyons so quickly after it screws up, and you can't necessarily even get into NL or GSBug). ga AFA Gary J My program hasn't really crashed, just the problem with the editor. AFA Gary J The ORCA editor is the only place it's showed up. The memory manager AFA Gary J business is probably it, because sometimes the ORCA editor will produce a AFA Gary J memory manager error instead of the invalid text data error. Dave Lyons (Okay, it wouldn't *have* to crash right away...it's just more fun that way.) AFA Gary J Thanks. GA AFL Dyfet Okay, that Q needs some questions :) BurgerBill Does anyone know anything about MIDISynth? AFA JoeyS Yuppers, Bill. AFL Dyfet Yes! Avery, go ahead, you have the floor now... Avery R C Is there a BASIC compiler that deals with the GS/OS tools? Avery R C Or has that already been answered? =P AFL Dyfet Well, Micol Advanced Basic can perform tool calls... AFL Dyfet GA Dave... Dave Lyons Okay...I haven't used them, but there are Micol Advanced BASIC and TML BASIC. They can Dave Lyons let you do GS toolbox calls, but I -believe- neither of them is as convenient as Pascal for Dave Lyons doing toolbox stuff. Especially because you want "records" for dealing with toolbox data Dave Lyons structures (so you can refer to pieces of the data structures by name, rather than by byte offsets). Dave Lyons ga AFL Dyfet (my preference is C, Dave L :) Avery R C Ok, I was thinking of ORCA/C anyway. Dave Lyons (should have said "as convenient as Pascal or C"--sorry!) Avery R C over and out AFL Dyfet Okay...Who has a question then :) BurgerBill Does anyone have information about the MIDISynth tool from Apple? BurgerBill I am interested in writing music using it. AFA JoeyS What kind of information? AFP TimB Its awesome. BurgerBill Well, how do I call it and use it in my own programs? AFL Dyfet GA Joey... AFA JoeyS Ummm... rough outline: Open sequence file. Get instrument (waveform) file, AFA JoeyS load that in, and define the instruments to use with _SetInstrument calls. AFA JoeyS Set up your tempo, tuning table, and anything else you need (optional, AFA JoeyS depending on your sequence)... then pass _SeqPlayer the address of the AFA JoeyS sequence data buffer. It takes over interrupts and plays the tune in the AFA JoeyS background; you can request that the tool call you back on each note, on AFA JoeyS instrument changes, at end of song, etc etc etc. Pretty nifty. I've got some AFA JoeyS not-yet-finished source (for a highly rumored MIDI Synth NDA, LOL) that I'd AFA JoeyS be willing to share with ya'. GA... BurgerBill Thanx, I need all the help I can get! :) AFL Dyfet Any other comments?? AFA Gary J That sounds great, Joey! AFA JoeyS No sweat -- scream a reminder to me in mail if I forget, okay? :) (I'm AFA JoeyS notorious for forgetting... uhh... everything!) BurgerBill Well I got some info that I need, thanx alot anyways!! AFL Dyfet GA Nuzz Nuzz Just a comment on Joeys answer. That sequence PLAYS songs, writing them is Nuzz quite different Nuzz GA AFA Gary J Joey missed your comment on his answer, I think :) AFA JoeyS I think so, yes... :-) Nuzz I just said that you described palying songs, not writing them AFA JoeyS Oh... I thought Bill asked how to play them back in his programs. .... AFA JoeyS Errr, to be honest, I haven't tried doing a MIDI recorder, but it looks AFA JoeyS as easy as playback. AFP TimB My suspicion is that playback is real easy, but a fully fledged sequencer is a lot more diff. Yes? Nuzz right Tim AFA JoeyS Yes, Tim -- depends on the amount of sophistication in your sequencer, AFA JoeyS too. AFL Dyfet GA Tim... AFP TimB Dave, Matt you know the current story on APDA and MIDISynth and a release date? Dave Lyons (Nope, just watch your APDAlog...that's all I know.) Matt DTS Same here. AFP TimB Last I heard Tim Swihart was fighting with APDA on pricing. AFL Dyfet GA Scott AFL Scott Has anyone noticed problems with window paramlists generated by Design Master AFL Scott in C? Dave Lyons (What kind of problems?) AFL Scott Ok... Under ORCA/C, I kept getting type conflicts in the record where ever a AFL Scott NULL was inserted... I looked at the record both in the header file and in the AFL Scott generated record and I can't see a problem. Dave Lyons (How is NULL #defined in your program?) AFL Scott 0x0L Dave Lyons Hmmm...I suppose changing it to ((void *)0) would cause other problems? AFL Dyfet But perhaps more correct a representation, Dave... AFL Scott I can do that... I didn't do it, yet, though. I was just fiddling to see if AFL Scott ORCA/C could get past the error.. it did, eventually, but now it errors out on AFL Scott the DefProc. :( AFL Scott (which btw is a VoidProcPtr). AFL Dyfet Hmm... Dave Lyons Shouldn't (void *)0 be a valid value for type void (*)() ? I thought void * was supposed to be Dave Lyons a pointer to *anything*, including a function. AFL Scott Looking... AFL Scott Your definition agrees with Harbison & Steel, Dave. Whether it agrees with AFL Scott Orca is up for tests after this conference. Dave Lyons (Gee...didn't mean to kill the discussion. Too many paentheses? :-) Matt DTS They're intimidated by you. AFL Dyfet NiftyLyons strikes again :) Dave Lyons (Data types are evil. You never have to type-cast a value in Nifty List. :-) AFA Gary J Thanks for the tip on my problem, Dave. I was wondering what could possibly AFA Gary J be still messed up after a warm re-boot. Dave Lyons (Yer welcome) Matt DTS Ask Dave sometime about leaving little handles around between reboots. AFL Dyfet :) Dave Lyons (Or ask Matt.) AFA Gary J Now's a good time :) AFL Dyfet Yes, it is :) AFA Gary J What happened, Dave??? Dave Lyons I -think- this is what Matt's referring to...a good way to accidentally leave "permanent" handles Dave Lyons around is to use the high word of a pointer as the memory ID! If they wind up with ID $0xxx, they Dave Lyons tend not to go away (this isn't a guaranteed system feature--it's just what happens today).