💾 Archived View for mirrors.apple2.org.za › archive › ftp.gno.org › doc › genie › a2pro › genielamp … captured on 2024-12-18 at 06:44:31.
-=-=-=-=-=-=-
|||||| |||||| || || |||||| |||||| || || ||| || || || || ||| |||| |||||| || |||| Your || || || || ||| || || |||||| |||||| || || |||||| |||||| GEnieLamp Computing || |||||| || || |||||| RoundTable || || || ||| ||| || || || |||||| |||||||| |||||| RESOURCE! || || || || || || || ||||| || || || || || ~ WELCOME TO GENIELAMP A2Pro! ~ """"""""""""""""""""""""""" ~ HyperLogo Ships ~ New A2U Course ~ ~ Tour of 8/16 Central ~ ProDev Inc. Joins A2Pro ~ ~ ORCA/Modula-2 Ships ~ 3D Logo Seminar Transcript ~ ~ Making Custom Icons ~ Animating Cursors ~ Stack Usage ~ ~ HOT NEWS, HOT FILES, HOT MESSAGES ~ ////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ GEnieLamp A2Pro ~ A T/TalkNET OnLine Publication ~ Vol.1, Issue 10 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Editor.......................................................Nate Trost Publisher.................................................John Peters Copy-Editor............................................Bruce Maples \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\//////////////////////////////////// ~ GEnieLamp IBM ~ GEnieLamp ST ~ GEnieLamp [PR] ~ GEnieLamp TX2 ~ ~ GEnieLamp A2 ~ GEnieLamp A2Pro ~ GEnieLamp Macintosh ~ LiveWire Online ~ ~ Member Of The Digital Publishing Association ~ GE Mail: GENIELAMP Internet: genielamp@genie.geis.com FTP: sosi.com ////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ >>> WHAT'S HAPPENING IN THE APPLE A2Pro ROUNDTABLE? <<< """"""""""""""""""""""""""""""""""""""""""""""""""""""" ~ December 1, 1993 ~ FROM MY DESKTOP ......... [FRM] HEY MISTER POSTMAN ...... [HEY] Notes From The Editor. Is That A Letter For Me? A2PRO ROUNDTABLE STAFF .. [DIR] TOUR OF 8/16 CENTRAL .... [TOU] Directory of A2Pro Staff. Great Programmers Magazine. LIBRARY BIT BONANZA ..... [LIB] UTILITIES FROM DOWN UNDER [UDU] HOT Files You Can Download. Three Great Utilities. DEVELOPERS CORNER ....... [DEV] 3D LOGO SEMINAR RTC [3DL] News From Online Developers. Lists, Movies and Logo Magic. CAMPUS GREEN ............ [CAM] LOG OFF ................. [LOG] New A2U Course Starts. GEnieLamp Information. [IDX]""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" READING GEnieLamp GEnieLamp has incorporated a unique indexing """"""""""""""""" system to help make reading the magazine easier. To utilize this system, load GEnieLamp into any ASCII word processor or text editor. In the index you will find the following example: HUMOR ONLINE ............ [HUM] [*]GEnie Fun & Games. To read this article, set your find or search command to [HUM]. If you want to scan all of the articles, search for [EOA]. [EOF] will take you to the last page, whereas [IDX] will bring you back to the index. MESSAGE INFO To make it easy for you to respond to messages re-printed """""""""""" here in GEnieLamp, you will find all the information you need immediately following the message. For example: (SMITH, CAT6, TOP1, MSG:58/M530) _____________| _____|__ _|O__ |____ |_____________ |Name of sender CATegory TOPic Msg. Page number| In this example, to respond to Smith's message, log on to page 475 enter the bulletin board and set CAT 6. Enter your REPly in TOPic 1. A message number that is surrounded by brackets indicates that this message is a "target" message and is referring to a "chain" of two or more messages that are following the same topic. For example: {58}. ABOUT GEnie GEnie's monthly fee is $8.95 for which gives you up to four """"""""""" hours of non-prime time access to most GEnie services, such as software downloads, bulletin boards, GE Mail, an Internet gateway, multi-player games and chat lines, are allowed without charge. GEnie's non-prime time connect rate is $3.00. To sign up for GEnie service, call (with modem) 1-800-638-8369. Upon connection type HHH. Wait for the U= prompt. Type: XTX99014,DIGIPUB and hit RETURN. The system will then prompt you for your information. Need more information? Call GEnie's customer service line (voice) at 1-800-638-9636. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" //////////////////////////////////////// GEnie_QWIK_QUOTE //// / "If it's a LARGER computer you want, / / why not just buy a BIGGER case?" / //////////////////////////////////////////////// J.KLAGES //// [EOA] [FRM]////////////////////////////// FROM MY DESKTOP / ///////////////////////////////// Notes From My Desktop """"""""""""""""""""" o TOP OF THE PAGE o NOTES FROM THE PUBLISHER >>> TOP OF THE PAGE <<< """"""""""""""""""""""" ~ Welcome to the December GEnieLamp A2Pro! ~ There's a lot of neat and exciting stuff going on in A2Pro, and you can learn all about it in this issue! The amount of things going on made putting this issue together a challenge, but it was well worth it. Below I'll briefly cover some of the highlights that are described in detail later on in the issue. A2 University has returned with a great new course on using the IIgs List Manager tool. This course, taught by Softdisk Publishing programmer Bryan Pietrzak, shouldn't be missed by anyone with an interest in IIgs desktop programming. Read the Campus Green column for more information. The 3D Logo seminars have been completed and we have another transcript from those seminars in this issue. 3D Logo is proving to be a powerful new language that makes learning programming concepts even easier and more fun than ever before. The Byte Works is actively supporting 3D Logo and its companion product, HyperLogo, in A2Pro. The Byte Works has also started shipping the new ORCA/Modula 2 compiler, a new language that adds to the suite of ORCA programming products. Procyon's new 2.0 version of the GNO/ME UNIX style multitasking environment is also generating a lot of excitement in A2Pro. Procyon has been busy giving support in A2Pro both in the bulletin board and the library. New versions of several GNO utilities are now available in the A2Pro library, and direct GNO kernel updates are available for registered users right in A2Pro! Be sure and check out Industry Connection in thisissue for more information from The Byte Works, Procyon, and the other companies that support Apple II programmers here in A2Pro. All this and much, much more this month! Enjoy the issue! Nate Trost GEnieLamp A2Pro [EOA] [DIR]////////////////////////////// A2PRO ROUNDTABLE STAFF / ///////////////////////////////// By Nate Trost [A2PRO.GELAMP] ______________________________________________ APPLE II PROGRAMMERS & DEVELOPERS ROUNDTABLE _____ ______ ______________________________________________ /_____|/______\ /__/|__| ___|__| Head Sysop: Matt Deatherage (M.DEATHERAGE) /__/_|__| /_____/ Assistants: Greg Da Costa (A2PRO.GREG) /________|/__/ __ __ __ Todd P. Whitesel (A2PRO.TODDPW) /__/ |__|__/______ /_//_// / Jim Maricondo (A2PRO.DYAJIM) /__/ |__|________// / \/_/ Nate Trost (A2PRO.GELAMP) [EOA] [HEY]////////////////////////////// HEY MISTER POSTMAN / ///////////////////////////////// Is That A Letter For Me? """""""""""""""""""""""" By Nate C. Trost [A2PRO.GELAMP] o BULLETIN BOARD HOT SPOTS o A2PRO ODDS & ENDS o WHAT'S NEW? o PROGRAMMER'S TIPS o HOT TOPICS o MESSAGE SPOTLIGHT >>>BULLETIN BOARD HOT SPOTS <<< """"""""""""""""""""""""""""""" [*] CAT9, TOP7, MSG{1}.................Applesoft BASIC help please! [*] CAT11, TOP8, MSG{9}........Programming Algorithms and Structures [*] CAT15, TOP4, MSG{66}................................QuickDraw II [*] CAT15, TOP8, MSG{84}..............................Sound Tool Set [*] CAT16, TOP8, MSG{1}.......................Writing ResLin Editors [*] CAT16, TOP13, MSG{25}..............Program Development Discussion [*] CAT19, TOP7, MSG{1}..........................Calling Conventions [*] CAT30, TOP2, MSG{1}....................................GNO Shell [*] CAT31, TOP9, MSG{89}...............GSLib - A Library of Routines >>>BULLETIN BOARD NEW TOPICS <<< """""""""""""""""""""""""""""""" [*] CAT16, TOP8.................................Writing ResLin Editors [*] CAT19, TOP7....................................Calling Conventions [*] CAT35, TOP1....................................About ProDev Online [*] CAT35, TOP2.....................Using the DDT Debugging Card Q & A [*] CAT35, TOP3........................DDT 8 & DDT 16 Bundled Software [*] CAT35, TOP4...........................................DDT Hardware [*] CAT35, TOP5.............................Modifying the DDT Software [*] CAT35, TOP6..........................Debugging Tips and Techniques [*] CAT35, TOP7............................Other Ideas and Discussions >>> A2PRO ODDS & ENDS <<< """"""""""""""""""""""""" TIM BUCHHEIM JOINS STAFF The December GEnieLamp A2Pro will be available """""""""""""""""""""""" in just a few days, so be sure to grab the November issue off the A2Pro Main Menu if you haven't done so already! It's full of all kinds of great information...that doesn't taste like chicken! In other GEnieLamp A2Pro news, I've hired a new staff writer to help me with the regular chores involved with putting each issue together. Starting with the January GEnieLamp A2Pro Tim Buchheim will be handling the RTC and Library sections of the Lamp. I'm glad to have the help and am looking forward to working with Tim, welcome aboard! Nate GEnieLamp A2Pro Lamplighter (A2PRO.GELAMP [65-Nate-16, CAT1, TOP15, MSG:78/M530) PROGRAMMER WANTED Hi All!!!! Can you believe it's been over 6 MONTHS """"""""""""""""" since I've been through this way?? I'm posting here because my company is looking for a _good_ 6502 programmer (thats plain old 6502...not 816! hehe) and I knew immediately where to come looking. Other assembly languages are a plus, and there will probably be much more than just 6502 to do. IBM PC based C, embedded systems, travel, lots of excitement (just like the army)...and lots of hard work. (I will let you use a GS for the 6502 though!). The position is full time, and would require relocation to Reno, NV..but we have several offices all over the country...maybe we could work something out. Give me a call during the daytime if you are interested and we'll talk dawgs, dawghters, cawfee, you know, just tawk. Shawn Quick Imagineering Systems, Inc. (702) 856-3900 (S.QUICK1, CAT13, TOP8, MSG:58/M530) >>> WHAT'S NEW? <<< """"""""""""""""""" EXPRESS TECHNICAL UTILITIES I should have done it earlier, but I've """"""""""""""""""""""""""" just uploaded some technical stuff for the Express print spooler from Seven Hills Software Corp. Included is a utility for viewing spool files, with the option of displaying all the ImageWriter II code descriptions (comes as as application, and a utility that adds a 'View' button to the normal Express edit dialog), and some IPC and data area technical notes. The spool viewer should come in handy for budding printer driver authors, as it formats it into seperate _PrDevWrite records, and in the case of it being an ImageWriter, also displays the what the codes are doing. Regards, Richard (btw: Forgot to mention that you need at least some Express spool files for any of this to be useful, and it would be preferrable to actually have Express) (RICHARD.B [Richard], CAT10, TOP26, MSG:38/M530) DEVELOP JOURNAL NOW IN A2PRO LIBRARY! > SyndiComm, who manages the """"""""""""""""""""""""""""""""""""" > Macintosh, Apple II, and > PowerPC RoundTables on GEnie, has signed a licensing agreement with > Apple Computer to provide these publications. You must read and agree > to a licensing agreement before you can download these files. Yes, folks, that means we'll get the Apple II content of _develop_ in the A2Pro libraries as soon as I can find some free moments to get it packed and write descriptions for it. There are five articles and several Q&A columns, though I'm not sure I can find all of them in text file format. Four of the articles have source code, and two of those are in MPW IIgs format. More news as they become available. :) --Matt (M.DEATHERAGE [A2Pro Leader], CAT1, TOP17, MSG:124/M530) >>> PROGRAMMER'S TIPS <<< """"""""""""""""""""""""" NEWHANDLE TIP Just thought I'd share a tip with people. The following """"""""""""" will fail: theHandle := NewHandle(0,gMemoryID,attrLocked,NIL); whereas this is just fine: theHandle := NewHandle(0,gMemoryID,0,NIL); Why? Because you can't have an empty, locked handle. That's why :) If you are creating an empty handle that will later be filled and need it to be locked, you'll just have to lock it later. (SOFTDISK.INC [Bryan Zak], CAT15, TOP2, MSG:96/M530) DEVICE UNIT NUMBERS I didn't see a topic for SmartPort, so I will ask """"""""""""""""""" this question here. Is there a TechNote or file around here that would show how to create a relationship between the Smartport Unit Number and the ProDOS unit number? What I am trying to do is ID the device type at a given slot,drive. Is the Smartport the way to go? If not, is there a preferred method for doing this type of thing? (KITCHEN.SINK [Eric], CAT7, TOP6, MSG:53/M530) <<<<< You can turn the ProDOS unit_number into a SmartPort identification """"" by following the steps in ProDOS 8 Technical Note #21, "Identifying ProDOS Devices." This Note tells you _everything_ that's reliable about identifying ProDOS devices, and has held off lots of questions since we first wrote it five years ago. --Matt (wow, has it been that long?) (M.DEATHERAGE [A2Pro Leader], CAT7, TOP6, MSG:54/M530) FINDING MEMORY USAGE Here's a question for anyone who might know: """""""""""""""""""" Suppose I know a user ID and I want to find out how much memory that particular ID is currently using in the system. Please note that the user ID is not "mine", but the ID of a system extension such as an NDA, CDA, INIT, Finder Extention, etc. What tool calls can be made to determine this information. It looks to me like I would need to know where there is a "list" of all handles in the system, then I can check their user-ID's and size, adding up the sizes when the user ID matched (masking off the aux ID's, if any). Anyway, this sounds like alot of work. Is this what needs to be done? If so, _where_ is the list of handles kept? How would I know if it is a _valid_ handle? Thanks in advance, Bill {W.TUDOR} (W.TUDOR, CAT15, TOP2, MSG90/M530) <<<<< If you downloaded GSLib there is a routine in there to do this """"" (MMIDInfo). You pass it a user ID and a mask (in case you want only memory associated with a certain auxiliary ID or something like that). It then returns a long indicating the total number of bytes associated with that ID. In any case, I did this by walking the handle chain and examining each handle. To do this, get a handle (I call FindHandle on the location of the subroutine) and walk the handle back to the head of the handle list. (The handle list is a double-linked list with NIL pointers at the head and tail for previous and next respectively). Once at the head, you can then just walk the entire handle chain. Pretty straight-forward actually. btw: you might want to know the structure of the data a handle points to: olocation EQU 0 ; offsets for handles oattributes EQU 4 ouserID EQU 6 olength EQU 8 olast EQU 12 onext EQU 16 (SOFTDISK.INC [Bryan Zak], CAT15, TOP2, MSG91/M530) 80 TO 40 COLUMNS What is the applesoft syntax to change from the 80 """""""""""""""" column screen to the 40 column screen. ( i.e. the equivalent of esc 4 ) (J.BAUER4 [oldman], CAT9, TOP7, MSG:98/M530) >>>>> In Applesoft, to change from 40 columns to 80 columns use: """"" PRINT CHR$(4);"PR#3" To change back to the 40 column mode, use: PRINT CHR$(21) : PRINT CHR$(12) Printing CHR$(21) switches to 80 column mode and the CHR$(12) clears the screen. It's best to use them together but not necessary. (R.NIELSON1 [Russ!], CAT9, TOP7, MSG:99/M530) DEAPS HEAPS TREES This seems as good a place as anywhere to ask this """"""""""""""""" question. :) I've been assigned a programming project for school in which we're required to use a data structure called a "deap". This is a tree in which every left child is the minimum value of the left subtree, and every right child is the maximum value of the right subtree. Has anybody heard of this? Has anybody got any sample source code for it? I'd like to see some sample source, or at least get a decent algorithm for programming this structure. I've been trying various routines, but they haven't been working as well as I'd like. In particular, I need routines to delete the minimum and maximum entries in a deap, and to insert a new value into the deap. (E.SHEPHERD [Sheppy], CAT11, TOP8, MSG:9/M530) >>>>> What you are describing as a "deap" is in reality a binary-tree. """"" First we need a data structure that describes each "Leaf" in the tree... typedef struct { void *Left; /* Left branch in the tree */ void *Right; /* Right branch in the tree */ unsigned int Val; /* Sort value */ } TreeNode; TreeNode Nodes[100]; /* Create as many leaves as there are entries */ unsigned int NodeCount = 0; /* No leaves are allocated */ Now we need a routine that creates a NEW leaf... Note : that an ending leaf is one that has NO left and right branches. /********************************** Create a new binary tree node **********************************/ void MakeNode (unsigned int Val) { TreeNode *NewNode; NewNode = &Nodes[NodeCount]; /* Get pointer to the new node */ NewNode->Left = 0; /* No children nodes */ NewNode->Right = 0; NewNode->Val = Val; /* Sort value */ NodeCount++; /* Index to the next free memory */ } /********************************** Insert a new node into my binary tree Note : This will also do a sort **********************************/ void InsertNode(unsigned int Val,objtype *Entry) { ActorNode * NewNode; if (NodeCount) { /* Only if there are entries! */ NewNode = Nodes; /* Go to the first entry */ for (;;) { if (NewNode->Val <= Val) { /* Which way should I go? */ if (NewNode->Right) { /* Is there a branch here? */ NewNode = NewNode->Right; /* Go there! */ } else { NewNode->Right = &Nodes[NodeCount]; /* Create a branch to the right */ break; } } else { if (NewNode->Left) { /* Is there a branch here? */ NewNode = NewNode->Left; /* Follow the branch */ } else { NewNode->Left = &Nodes[NodeCount]; break; } } } } MakeNode(Val,Entry); /* Create a NEW node and exit */ } /********************************** Now, let's replay the data SORTED! **********************************/ void PlayNodes(TreeNode *NewNode) { unsigned int Val; /* Pointer to active object */ if (NewNode->Left) { /* Is there a farther object? */ PlayNodes(NewNode->Left); /* Draw it */ } Val = NewNode->Val; /* Get the pointer to the current object */ DoStuff(Val); /* Do the action */ if (NewNode->Right) { /* Is there a closer object? */ PlayNodes(NewNode->Right); } /* Exit! */ } Wasn't that easy!!! Bill Heineman (BURGERBILL, CAT11, TOP8, MSG:10/M530) <<<<< I have never heard of such a beast named "deap". Are you sure it """"" is not a "heap" instead ? (Not to be confused with the name of the memory that can be dynamically allocated with malloc() or NEW, as it is often called in the C and Pascal languages). A "heap" is a data structure used mostly for a sort algorithm appropriatly named "heapsort" and another data structure : the "priority queue"; this last one is a queue when the first out is not necessarily the first in, but the one with the highest priority, whatever that means for the problem at hand. Usually, heaps and priority queues are interchangeable, although the first is the means of implementing the second. A heap is a binary tree which must satisfy these 3 rules : 1) The tree must be balanced, that is the difference in height of all leaves must be at most 1 (the height of a tree is the length from the root to the lowest level). In other words, all the leaves of the tree must be on two adjacent levels. 2) It must be also complete. That means that all the levels of the tree must be filled, except maybe the lowest. That implies that nodes are inserted into a level of the tree from left to right until that level is full, in which case a new level is started. 3) The root of each subtree has a value which is larger than the values of all of its children. That means that the root of the tree has the largest value. However, the siblings of each node do not have to be ordered. Here is an example of an heap : J /------------------/ \------------------\ I F /------/ \------\ /------/ \------\ G H B E /--/ \--\ /--/ A D C While a classic binary tree is best represented with a linked data structure, a heap is usually stored in an array. In fact, from the first 2 rules above, a node at position N in the array has its 2 children at nodes 2N and 2N+1 if the array starts at index 1 (if it starts at index 0, like in C, the children will be at indices 2N+1 and 2N+2). Thus the node at index 1 has its children at indices 2 and 3, the node at index 2 will have its children at indices 4 and 5, and so forth. This representation is very efficient for a priority queue or for the heapsort, for which the only operations are "insert" and "delete"; however, it would be fairly inefficient if it was used for a general data structure. Furthermore, the usage of an array requires that the maximum number of nodes is known in advance. The above tree is thus represented as this in an array : J I F G H B E A D C node values 1 2 3 4 5 6 7 8 9 10 array indices A new node is inserted in the tree by adding it at the end and then reordering the tree to satisfy the heap rules defined above (this is called reheaping); this is done from the bottom of the tree to the top (ie from the right to the left of the array). For the deletion, we always remove the largest node which is the first (ie the root of the tree); here, the reheaping is done from left to right after copying the rightmost node into the first and decreasing the size of the array. Here is a sample implementation in Pascal (N is the current size of the array and H is the heap; for this example, each cell contains a single integer) : procedure init_heap; begin N := 0; H[0] := maxint; end; procedure insert ( i : integer ); var j, k : integer; begin N := N + 1; H[N] := i; k := N; j := H[k]; while ( H[k div 2] <= j ) do begin H[k] := H[k div 2]; k := k div 2; end; H[k] := j; end; The algorithm works as follows : the new node is added at the end of the array; then if the new child is greater than its parent, they are swapped; that fixes the heap rule violation. This may again violates the rule, so this process is repeated until the array satisfies the rule. Note that the heap starts with a pseudo-element 0 which is used to break out of the loop without requiring to check the value of K. function remove : integer; label 1; var i, j, k : integer; begin remove := H[1]; H[1] := H[N]; N := N - 1; k := 1; i := H[k]; while ( k <= N div 2 ) do begin j := k * 2; if ( j < N ) then if ( H[j] < H[j+1] ) then j := j + 1; if ( i >= H[j] ) then goto 1; H[k] := H[j]; k := j; end; 1 : H[k] := i; end; This functions moves down the heap, swapping node at position K with the larger of its 2 children if necessary, and stopping when reaching the bottom of the heap or when node K is larger than its 2 children (this second condition required the use of the GOTO statement, since ORCA/Pascal does not support breaking out of a loop :-) I also had to use 2 ifs to check for the largest child in case node K has only one child, because in ORCA/Pascal the AND does not short-circuit the second comparison. (P.MANET1 [Philippe], CAT11, TOP8, MSG:15/M530) NO MONSTERS ALLOWED? Hee hee, I just had a little flashback this evening """""""""""""""""""" and tried something I had forgotten about...and it still works with Basic.System 1.5. At the prompt: NO MONSTERS ALLOWED Think I originally saw that mentioned in the old Big Tip Book. Nate (still amused for some strange reason :-) (A2PRO.GELAMP [65-Nate-16, CAT7, TOP4, MSG:24/M530) >>>>> The reason it works is that NOMON is a perfectly valid """"" command under DOS 3.3, and to make porting programs easier, B.S supports it. It just ignores it though, including the parameters (as you found out). MON, on the other hand, was changed to MTR in the newer versions and puts you into the Monitor (lizard). But it, too, was a do-nothing in the earlier versions. (QUALITY, CAT7, TOP4, MSG:25/M530) ANIMATING CURSORS Okay, question of the day: what is the proper method """"""""""""""""" of doing an animated cursor? Is it ok to call SetCursor from within a hearbeat task? (SOFTDISK.INC [Bryan Zak], CAT15, TOP4, MSG:75/M530) >>>>> Well, technically, yes, but it's kind of bad form. In a heartbeat """"" task, since it's based on an interrupt, your cursor continues to spin even if you crash or enter an infinite loop, as long as you don't lock out interrupts. This is not the kind of user feedback one would hope for. :) The best thing to do in any periodic task is regularly check for commandperiod and animate the cursor at the same time. --Matt (M.DEATHERAGE [A2Pro Leader], CAT15, TOP4, MSG:76/M530) <<<<< I don't remember right off, but I believe Cool Cursor uses the """"" scheduler to change the cursor. When it's time to change, the heartbeat fires off, and that schedules the cursor change. Then when the system is free to do stuff, the scheduler fires off and the cursor changes. (JWANKERL [Joe], CAT15, TOP4, MSG:77/M530) PASCAL'S TRIANGLE IN BASIC I'm looking for help with an algorithim (in """""""""""""""""""""""""" Applesoft BASIC) to produce Pascal's Triangle. Pascal's Triangle is a mathematical problem that has the number 1 at the top and along both sides. The center numbers are the answer from adding the two numbers above. Shown below is an example with 7 rows: 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 1 7 21 35 35 21 7 1 I figure that you have to use a couple of arrays and add the values in one array to produce the next array, then move the new array into the old array and repeat the procedure for the next row, etc., but I'm just not sure how to code it. Any help would be appreciated. (L.ELSEMAN1 [LARRY], CAT11, TOP8, MSG:16/M530) <<<<< Well, you don't have to use arrays, but before I explain how, """"" here's the little background I know just in case. Pascal's Triangle is a representation of powers of (a + b). If X is the power (a + b) is being raised to, then for different values of X you get: X=0: 1 X=1: 1a^1 + 1b^1 X=2: 1a^2 + 2a^1b^1 + b^2 X=3: 1a^3 + 3a^2b + 3ab^2 + 1b^3 which starts to reveal the pattern of the Triangle: 0: 1 1: 1 1 2: 1 2 1 3: 1 3 3 1 Look at level three (X=3). Notice that the power that 'a' possesses in each group goes from 3 on the left down to 0 on the right. The opposite effect appears for 'b' (0 to 3). Now, a little trick my Theory of Computing professor showed me: if you begin with a one on the left, multiply that value by the exponent of 'a' and divide by one more than the the exponent of 'b', you get the number that goes with the next group on that level. For example, in level three: begin with 1 multiply by 3 and divide by 0+1 to get 3 multiply by 2 and divide by 1+1 to get 3 multiply by 1 and divide by 2+1 to get 1 which yields level three's sequence, 1 3 3 1, or a^3 + 3a^2b + 3ab^2 + b^3. This works for any level in the Triangle, so if the level you are looking for is in the variable TriExponent, the following will print the correct sequence of numbers in that level: Mult = 1 for i = TriExponent to 1 step - 1 print Mult; " "; Mult = Mult * i / (TriExponent - i + 1) next i (K.FLYNN [ Chris ], CAT11, TOP8, MSG:18/M530) GETDEVICENAME I'm not sure of the correct way to handle the """"""""""""" GetDeviceName call. This is what I was considering doing: GetDeviceName anop pha pha _PrGetPrinterDvrName _PrDevPrChanged plb clc lda #$0000 rtl Is this correct? (H.WILKINSON2 [Heath], CAT16, TOP3, MSG:17/M530) >>>>> The Print Manager calls this driver routine when the printer """"" driver has changed. If you have a network string that identifies your driver, you pass it to _PrDevPrChanged. Otherwise, you don't have to do anything as far as I can tell. I'd prefer doing nothing to passing something that's not a network NBP entity. By the way, as part of our license with Apple, we now have the rights to upload my sample printer driver Picter and the article from _develop_ #4 about how to write a printer driver. I hope I can get this uploaded by week's end. --Matt (M.DEATHERAGE [A2Pro Leader], CAT16, TOP3, MSG:18/M530) COMPILING IN GNO I have a few questions about writing programs and """""""""""""""" compiling from within GNO. The first is how to set the language type when invoking the editor (right now I'm using the ORCA editor). I can change the SYSTAB file for the editor as described in the ORCA C manual (first field to 7 for C), but will I have to do this before using the editor when I want to use Pascal instead (assuming I buy Pascal as well)? What if I'm using vi or EMACs instead? How would I set the language so the COMPILE command will work? My second question is what is the command to compile the source, invoke the linker, and produce an execucable file? If I use COMPILE, it stops before the linker. Is there another command I should use or a flag that should be set? I am also having problems with the man command. If I enter "man yankit" my system hangs for a long time (I usually reboot). I can't find a man page for yankit in any of the directories. Also, compile doesn't have a man page as well, but "man compile" just reports this. I have a rom 1 GS with 4 meg and am using GNO 2.0.3. Now that I've had some time to read the Orca manual, I'm stumped. How do I use "edit" (Orca editor) from GNO so that it saves C type files that I can later compile? Right now I have to do everything from the Orca shell and then start GNO up. Michael (M.POTTER4 [AppleNET], CAT30, TOP1, MSG:23-24/M530) <<<<< > How would I set the language so the COMPILE command will work? """"" Use: chtyp -l lang filename See the manual page on chtyp for valid langauge types. You have to create the file first and then set the type; I agree that this is annoying, but it will be resolved sooner or later. >If I use COMPILE, it stops before the linker. use 'CMPL'. Also, make sure your gshrc file contains: set keepname='\