TweetFollow Us on Twitter

Alphabet Soup
Volume Number:1
Issue Number:1
Column Tag:BASIC SCHOOL

“Alphabet Soup”

By Dave Kelly

“Alphabet Soup”

Welcome to Basic School! This article is dedicated to those of us that enjoy programming in Basic. Programmers of structured languages have put Basic down for several years because it is not considered a structured programming language and many implementations of Basic lack enhancements which give it power to perform advanced functions. Also it has been said many times that it is much harder to follow the program flow in Basic than in other languages like Pascal. Those who complain about the limitations of Basic are sometimes quite justified in their complaints. After all, basic “BASIC” isn’t very powerful and not very flexible at all. Any enhancement at all is an improvement. This has been the caseup until now. Now, the enhancements that we find in Macintosh Basic are approaching the power of the more acceptable high level languages such as Pascal. Exploring Macintosh Basic computing power is what this column is all about.

In the last few months we have seen the evolution of the programming tools needed to program the Mac on the Mac. In the coming issues, we will explore the enhancements included in the new MacBasic and in Microsoft Basic Version 2.0. At the writing of this article Microsoft tells me that they intend to release Microsoft Basic Version 2.0 by the end of October or sometime in November. I’m told that it includes many enhancements which in my opinion should have been included from the very first introduction of Microsoft Basic to the Macintosh world. These enhancements include programmable windows, menus, scrolling, sound and sound effects, compatability with MacWrite, complete mouse control, editing, debugging, access to most if not all of the Mac internal ROM routines, and elimination of the need for line numbers. This is what I call programming made easy. From what I’ve seen so far, there will be quite a competition between MacBasic and Microsoft Basic 2.0 in the coming months.

The Mac Basic listing shows an example of the ease in documenting a program as it is written. I originally wrote the program in Microsoft Basic version 1.0 as an educational tool for my 2 year old to learn his alphabet. The program prints the alphabet and then prompts the user to find each letter one at a time.Then the user points to the letter with the mouse and presses the mouse button. By using variable names that show what is happening and by the use of line labels the program requires little documentation. When I write programs, I rarely have the time to finish up with documentation especially when my 2 year-old can’t wait to start the game. The use of these labels will be familiar to anyone who has used Basic on the Hewlett Packard 9826-36 series computers. The label name is used in each of the gosub statements in place of the line numbers. This makes the use of line numbers unnecessary. The coresponding label name also appears at the beginning of the subroutine followed by a colon. By indenting the text of the program within each subroutine, it is clear where the subroutine starts and ends and the label gives a clue as to what each subroutine does.

Next month we will explore Basic programming on the Mac in more detail.

10 ‘*********************************
20 ‘         Alphabet Soup
30 ‘         By David Kelly
40 ‘         MS Basic Version 1.0
70 ‘*********************************
1000 DIM TOP%(26),BOT%(26),RGT%(26),LFT%(26)
1010 FOR LETTER%=1 TO 26
1020       READ LFT%(LETTER%), TOP%(LETTER%), RGT%(LETTER%), BOT%(LETTER%)
1030 NEXT LETTER%
1040 GOSUB 1090:   ‘ Print_alphabet
1050 FOR LETTER%=ASC(“A”) TO ASC(“Z”)
1060       GOSUB 1200: ‘Ask_for_letter
1070 NEXT LETTER%
1080 CALL TEXTMODE(0):CALL TEXTFACE(0):CALL TEXTFONT(1):CALL TEXTSIZE(12):END

1090 ‘ Print_alphabet to screen
1100 CLS :  ‘Clearwindow
1110 CALL TEXTFONT(2): ‘ Set to New York Font
1120 CALL TEXTSIZE(24): ‘ Set Font size to 24
1130 CALL TEXTMODE(2): ‘Sets screen to XOR
1140 CALL TEXTFACE(0): ‘Sets face to plain style
1150 FOR LETTER% = 1 TO 26
1160  CALL MOVETO(LFT%(LETTER%),BOT%(LETTER%)):PRINT CHR$(ASC(“A”)-1+LETTER%)
1170 NEXT LETTER%
1180 CALL TEXTSIZE(12):  ‘Set font size to 12
1190 RETURN

1200 ‘ Ask_for_letter
1210 CALL MOVETO (125,175):PRINT “Find the letter: “;
1220 CALL TEXTSIZE(24): ‘Set Font size to 24
1230 CALL TEXTMODE(0)
1240 PRINT “ “;CHR$(LETTER%)
1250 CALL TEXTSIZE(12)
1260 CALL PENMODE(10)

1270 IF MOUSE(0)=0 THEN 1270: ‘button wait
1280 X2=MOUSE(1): Y2=MOUSE(2)
1290 CALL MOVETO(238,168):CALL LINETO(X2,Y2)
1300 IF MOUSE(0)<0 THEN 1300
1310 IF (X2<LFT%(LETTER%-64) OR X2>RGT%(LETTER%-64) OR Y2< TOP%(LETTER%-64) 
OR Y2 >BOT%(LETTER%-64)) THEN FLAG%=1 ELSE FLAG%=0

1320 CALL PENMODE(14):PATTERN%(0)=0:CALL PENPAT(VARPTR(PATTERN%(0)))
1330 CALL MOVETO(238,168): CALL LINETO(X2,Y2):CALL PENNORMAL
1340 CALL TEXTMODE(0):IF FLAG% =1 THEN 1210
1350 BEEP:BEEP
1360 RETURN

1370 DATA 36,20,52,74           :’A data
1380 DATA 72,20,84,74           :’B data
1390 DATA 103,20,115,74       :’C data
1400 DATA 133,20,147,74       :’D data
1410 DATA 165,20,176,74       :’E data
1420 DATA 195,20,207,74       :’F data
1430 DATA 225,20,239,74      :’G data
1440 DATA 257,20,272,74       :’H data
1450 DATA 290,20,315,74       :’I data
1460 DATA 330,20,350,74       :’J data
1470 DATA 369,20,383,74       :’K data
1480 DATA 401,20,414,74       :’L data
1490 DATA 434,20,454,74       :’M data
1500 DATA 35,75,51,120         :’N data
1510 DATA 69,75,83,120         :’O data
1520 DATA 101,75,115,120     :’P data
1530 DATA 133,75,147,120     :’Q data
1540 DATA 165,75,179,120     :’R data
1550 DATA 197,75,208,120     :’S data
1560 DATA 227,75,240,120     :’T data
1570 DATA 259,75,275,120     :’U data
1580 DATA 294,75,310,120     :’V data
1590 DATA 329,75,352,120     :’W data
1600 DATA 371,75,385,120     :’X data
1610 DATA 402,75,417,120     :’Y data
1620 DATA 434,75,445,120     :’Z data

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Delve back into the Sanctum of Rebirth t...
I don’t know about you, but I am all for a big, interconnected tree of lore in games or series. The MCU, the fabulous marathon that is The Legend of Heroes, and the long-running MMO Runescape. The Ode of the Devourer quest has released and is the... | Read more »
TouchArcade is Shutting Down
This is a post that I’ve known was coming for quite some time, but that doesn’t make it any easier to write. After more than 16 years TouchArcade will be closing its doors and shutting down operations. There may be an additional post here or there... | Read more »
Combo Quest (Games)
Combo Quest 1.0 Device: iOS Universal Category: Games Price: $.99, Version: 1.0 (iTunes) Description: Combo Quest is an epic, time tap role-playing adventure. In this unique masterpiece, you are a knight on a heroic quest to retrieve... | Read more »
Hero Emblems (Games)
Hero Emblems 1.0 Device: iOS Universal Category: Games Price: $2.99, Version: 1.0 (iTunes) Description: ** 25% OFF for a limited time to celebrate the release ** ** Note for iPhone 6 user: If it doesn't run fullscreen on your device... | Read more »
Puzzle Blitz (Games)
Puzzle Blitz 1.0 Device: iOS Universal Category: Games Price: $1.99, Version: 1.0 (iTunes) Description: Puzzle Blitz is a frantic puzzle solving race against the clock! Solve as many puzzles as you can, before time runs out! You have... | Read more »
Sky Patrol (Games)
Sky Patrol 1.0.1 Device: iOS Universal Category: Games Price: $1.99, Version: 1.0.1 (iTunes) Description: 'Strategic Twist On The Classic Shooter Genre' - Indie Game Mag... | Read more »
The Princess Bride - The Official Game...
The Princess Bride - The Official Game 1.1 Device: iOS Universal Category: Games Price: $3.99, Version: 1.1 (iTunes) Description: An epic game based on the beloved classic movie? Inconceivable! Play the world of The Princess Bride... | Read more »
Frozen Synapse (Games)
Frozen Synapse 1.0 Device: iOS iPhone Category: Games Price: $2.99, Version: 1.0 (iTunes) Description: Frozen Synapse is a multi-award-winning tactical game. (Full cross-play with desktop and tablet versions) 9/10 Edge 9/10 Eurogamer... | Read more »
Space Marshals (Games)
Space Marshals 1.0.1 Device: iOS Universal Category: Games Price: $4.99, Version: 1.0.1 (iTunes) Description: ### IMPORTANT ### Please note that iPhone 4 is not supported. Space Marshals is a Sci-fi Wild West adventure taking place... | Read more »
Battle Slimes (Games)
Battle Slimes 1.0 Device: iOS Universal Category: Games Price: $1.99, Version: 1.0 (iTunes) Description: BATTLE SLIMES is a fun local multiplayer game. Control speedy & bouncy slime blobs as you compete with friends and family.... | Read more »

Price Scanner via MacPrices.net

Amazon and Best Buy have Apple’s 10th-generat...
Amazon and Best Buy are offering $50-$30 discounts on Apple’s 10th-generation iPads this week, with models now available starting at only $299. These are the lowest prices available for Apple’s... Read more
Red Pocket Mobile is offering a $300 rebate o...
Red Pocket Mobile has new Apple iPhone 16’s on sale for $300 off MSRP when you switch and open up a new line of service. Red Pocket Mobile is a nationwide MVNO using all the major wireless carrier... Read more
New at Xfinity Mobile: iPhone 16 Pros for $40...
Switch to Xfinity Mobile with a new line of service, and take $400 off the price of any new iPhone 16 Pro through October 10, 2024. Final value is applied to your account, monthly, over a 24-month... Read more
16-inch Apple MacBook Pros on sale this week...
Best Buy has 16″ M3 Pro and M3 Max Apple MacBook Pros on sale for $500 off MSRP on their online store this week. Prices valid for online orders only, in-store prices may vary. Order online and choose... Read more
iPhone 15 and 15 Plus free at Verizon for new...
Verizon has the iPhone 15 and iPhone 15 Plus now on sale for $0 per month (that’s free!) when you add a new line of service. No trade-in is required. Discount is applied to your account monthly over... Read more
Verizon offers free iPhone 16 and 16 Pro mode...
Verizon is offering $1000 discounts on the new iPhone 16 Pro, $830 for the 16 and 16 Plus, for customers opening a new line of service. Discount is applied via monthly bill credits over a 36 month... Read more
AT&T offers free iPhone 16 and 16 Pro mod...
AT&T is offering $1000 discounts on the new iPhone 16 Pro, $830 for the 16 and 16 Plus, for new and existing customers with an eligible trade-in. Discount is applied via monthly bill credits over... Read more
Buy a new iPhone 16 at Visible, and get $10 o...
Switch to Visible, and buy a new iPhone 16 (full price or financed), and Visible will take $10 off their monthly Visible+ service for 36 months. Visible is Verizon’s low-cost service. Visible+ is... Read more
Apple iPhone 16 deals are live at Xfinity Mob...
Switch to Xfinity Mobile with a new line of service, and take up to $1000 off the price of a new iPhone 16 through October 10, 2024. Final value is applied to your account, monthly, after qualifying... Read more
Get a free iPhone 16 at Boost Mobile plus Unl...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering a free 128GB iPhone 16 or 16 Pro including service with their Unlimited plan (30GB of premium data) for a total charge of $65... Read more

Jobs Board

EUC *Apple* /MAC Platform Engineer - Corning...
EUC Apple /MAC Platform Engineer **Date:** Sep 13, 2024 **Location:** Charlotte, NC, US, 28216Corning, NY, US, 14831 **Company:** Corning Requisition Number: 64844 Read more
*Apple* Systems Administrator - JAMF - Activ...
…**Public Trust/Other Required:** None **Job Family:** Systems Administration **Skills:** Apple Platforms,Computer Servers,Jamf Pro **Experience:** 3 + years of Read more
Seasonal Operations Associate - *Apple* Blo...
Seasonal Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Read more
Secret *Apple* MacOS Workspace ONE AirWatch...
Job Description The Apple MacOS Workspace ONE AirWatch Engineer role is primarily responsible for managing a fleet of 400-500 MacBook computers. The ideal candidate Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.