TheAmazingAdventuresof
Featuring C64COMAL 0.14 GettingStarted
page2
How To Do It
page4
JustBeginners
page6
WhatIsCOMAL?
page8
DareTo Compare
BASIC page11
BITESTHE ComparisonChart page11
DUST Questions/Answers
page12
Letters
page14
COMAL Books
page15
Top10Books
page15
4SamplePrograms
page16
BackupDisks
page20
COMAL isthewinner!Seepage11. CopyFiles
page22 INSIDE:4 readytotypeprograms:
DoubleSidedDisks GraphicsDesigner page23 ElectronicPhonebook TheWalker How To Order Ready,Aim,Draw page24
Artworkby:D.EvansandWayneSchmidt
CaptainCOMALisregisteredtrademarkofCOMALUsersGroupUSALtd. HowtoGetStarted
Thereis morethanoneway to startwith wouldliketo run,presstheSTOPkeyto
COMAL.Here are somesuggestions: stopthecatalog.On a blanklinetype:
chain"name"
Get theProgrammersParadisePackageand
optionalTutorialDiskand get twoextra Of course,youwillreplacethename
disksfree:Bestof COMALandAutoRun with the name of the programyou want to
Demo.The packageincludesthe reference see.Spellit right.Don'tusetheshift
bookCOMALFromA To Z and fourback key with letters.
issuesof COMALTODAY.The complete
COMAL0.14systemis on eachdisk,so Use the STOPkey to stopany programyou
you maystartwithany of them.We even try.Thenyou cando thesamething
includea FastLoaderat no extra againwithanotherprogram.
charge.Thispackageis an unbelievable
bargain:only$24.95plus$2 shipping If you are interestedin whata COMAL
(subjectto change- two disksmay be programlookslike,STOPoneof the
suppliedon one doublesideddiskette). programs,and issuethecommand:
list
Onceyou have all this,the question*
becomes:"Whatdo I do next?"First, COMALdisplaystheprogramforyou.The
readthiswholeinformationflyer.Next, CTRLkey slowsthe listingdown.Press
backupthe disksand storethe originals theSPACEBAR to pausethe listing.
in a safe place.A backupprogramis PressSPACEagain to resume.
includedon theProgrammersParadise
Disk(seepage20 for instructions). Onceyou have seen someCOMALprograms
Then,start uptheAutoRun DemoDisk: in action,you shouldbe readyforthe
20 lessontutorial.PlacetheTutorial
Turn computer systemon. ; Diskinto thedriveand startit up:
InsertAutoRun DemoDisk.
Type: load"boot*",8 FROM BASIC:
run load"boot*",8
run
Youwillsee 26 COMALprograms,one
afteranother,all automatically.No FROM COMAL:
needto eventouchthekeyboard.When chain"menu"
you are readyto stop,pressthe STOP
keyto stopa runningprogram.It will Do thelessonsin orderbeginningwith
automaticallyreturnyou to themain lessonone.Aftereachlessonis over,
menu.Thenpressthe STOPkey again.You it willreturnyou backto the menu.
thenwillbe in COMALprogrammingmode.
OnceyouhaveseenCOMALprograms,and
To seemoreCOMALprograms,placethe havelearneda littleaboutCOMALfrom
BestOf COMALor ProgrammersParadise thetutorialsystemtfinda comfortable
Diskin the driveand type: chairand flipthroughthe sampleissues
cat of COMALTODAY.At 80 pageseach,they
arelikesmallbooks. Skipthetechnical
If you seea programlistedthatyou and advancedarticlesand concentrateon
More►
page2,COMAL UsersGroupUSA Ltd,6041MononaDr,Madison,WI53716,phone608-222-4432 FILENAMECONVENTIONS How To GetStarted-continued
thebeginninginformation.Youcanread To helpyou distinguishbetweenthemany themagainlaterformoreadvanced typesof diskfilespossible,we use the information.Finally,pagethroughthe followingfilenameconventions(COMAL bookCOMALFromA ToZ. It isa mini 0.14usuallyusesa suffix.COMAL2.0 referenceto theCOMALkeywords. usuallyuses a prefix):
Now,exploreonyourown.Trychanging SuffixedPrefixed Meaning _ someof theprograms.It iseasierat NAME NAME COMALprogramfile firsttostartwitha working program NAME.L LST.NAME ASCIIprogramlist andjustmakechanges!g] NAME.PROCPROC.NAMEPROClistedto disk
NAME.FUNCFUNC.NAMEFUNClistedto disk
DDDDDDDDDDDDDDnDDDDDDDDDnDDnDDDn NAME.DAT DAT.NAME Datafile NAME.TXT TXT.NAME Textfile
NAME.DOC DOC.NAME Documentationfile
HOW TO TYPE IN EXT.NAME ExternalPROC/FUNC COMAL PROGRAMS SHAP.NAMESpriteshapefile FONT.NAMECOMALfontfile
FONT.MC.NAMEMulticolorfontfile
Linenumbersare irrelevantto a running SET.NAME Basictypefontfile
COMALprogram.COMALonlyprovidesline PKG.NAME Packagefile numbersforyourbenefitin editingthe BAT.NAME Batchfile" .] program.Thusmostmagazinesdo notuse SNG.NAME Songfile
linenumberswhenlistinga COMAL HRG.NAME ColorCOMALpicture
program.It is up toYOUto providethe NAME.HRG Black/Whitebitmap
linenumbers.But of course,COMALcan CRG.NAME Compactedcolorpix
do it foryouquiteeasily.Justfollow NAME.CRG CompactedB/W bitmap
thesestepsto type ina COMALprogram: NAME.SRC AssemblerSource NAME.OBJ AssemblerObject
NAME.PPC Paperclipfile© 1) Entercommand:NEW
2) Entercommand:AUTO
3) Typein theprogram
4) Whendone:
Version0.14:Hit
Version2.0 : Hit
WhenyougettheProgrammersParadise
Remember- useunshiftedletters Package,you getmore thanthebest
thoughoutenteringtheprogram.If programminglanguage.You alsoget
lettersarecapitalizedin thelisting demonstrationprogramsto showyouwhat
it doesnotmeanto useSHIFTwiththose COMALcan do. One of theseprogramsis
letters.Theyarecapitalizedmerelyto CRG14.VIEWER.Thisprogramletsyouview
be easyto read.The onlyplaceto use compactpicturesstored ondisk (CRGis
SHIFTED lettersis insidequotes.Also, thefilenamesuffixforcompactpicture
youdon'thaveto typeleadingspacesin files).Of coursealso we includesome
a line.Theyarelistedonlyto show compactpicturefilesforyou to start
structures.You DO have to typea space with,includingourownCALVINTHECOMAL
betweenCOMAL wordsin theprogram.g TURTLE(heis smilingon thelastpage).
COMAL UsersGroupUSA Ltd,6041MononaDr,Madison,WI 53716,phone608-222-4432,page3 HowToDoItInCOMAL
** How to startC64 COMAL0.14 ** How to lookat a program
PutCOMALdiskintodrivethentype: If theprogramis not in thecomputer
load"boot*",8 yet,firstLOADtheprogram:
run load "name"
** How to returnto BASICfrom COMAL To see theprogramin the computertype:
list
Typethecommand:
basic TheCTRLkey slowsdownthedisplay.To
pauseit,pressthe SPACEBAR.Press
** How to seewhat is on a disk SPACEagainto resume.Seepage38 of
COMALFromA To Z formoreinformation. Putthediskintothe drive.Type:
cat ** How to writea new program
The CTRLkey slowsthe displayscroll. Issuethe commands: new
** How to retrievea programfromdisk auto
Put the diskintothe drive.Find the Now,typein theprogram.Hit RETURNkey
programnameexactspelling(seeCAT twicein a row to stoptheAUTOmode.
above).Typethe command(replacename Seepage3 formoreinformation.
withthenameof theprogramyouwant):
load"name" ** How to eraselinesin a program
** How to run a programthatis already Findthe linenumberof the lineto be
in thecomputer erased(line100 in thisexample),then
issuea DEL command:
Issuethe command: del 100 run
You may deletea blockof linesall at
** How to run a programfromdisk once.Findthe firstand lastline
numbersin theblockof lines(lines500
Putthediskintothe drive.Findthe thru750for thisexample),thenissuea
exactprogramname (seeCAT above).Type DEL command:
thecommand(replacenamewith thename del 500-750
of theprogramyou wantto run):
chain"name" Seepage20 of COMALFromA To Z for
moreinfo.
** How to stopa runningprogram
** How to add linesto theend of a
PresstheSTOPkey.If thatdoesn't program
work,presstheRESTOREkeyandSTOPkey
simultaneously(resets COMAL). Theprogrammustbe in thecomputer.
Findthelastlinenumbercurrentlyused
More►
page4,COMAL UsersGroupUSA Ltd,6041MononaDr,Madison,WI 53716,phone608-222-4432 !■■■■■■■■■■■■■■
How To Do ItInCOMAL -continued
(630forthisexample).Thenissuethe computer.Issuethe commands:
command: select"lp:"
auto640 list
Specifya startinglinethatis 10 more ** Howto setprinterautolinefeeds
thanthe lastlinein theprogram. linefeed* turnslinefeedson
** How to add linesin the middleof a linefeed- turnslinefeedsoff
program ** Howto accessthedeviceand
Theprogrammustbe in the computer. secondaryaddress
Locatetheplaceyou wishto add a line.
Forexample,betweenthe following: Sendalloutputto printerdevice4,
secondaryaddress7 (lowercasemode):
0040PRINT"WELCOMETO MY PROGRAM" openfile255,"lp:",unit4,7,write
0050PRINT"HOPEYOU ENJOYIT" select"lp:"
Typein the lineto add,usinga line Sendoutputto device5 printer:
numberbetweenthe twolines. openfile255,"lp:",unit5,write select"lp:"
0045PRINT"WRITTENON DECEMBER25, 1985
Accessto diskdrivedevice9 rather
Numberinga programby 10fsallowsyou thandefaultdevice8 by addinga ",9"
to easilyaddup to 9 linesbetweenany at the end of many commands:
currentlines. save,"name",9 load"name",9
** How to renumbera program chain"name",9 openfile2,"name",unit9,read
Ifyouaddor deletelinesin a program,
it is easyto restoretheprogramto be ** How to fliptextand graphicsscreens
numberedby 10fs.Issuethecommand: remun Initializethegraphicsscreenthefirst
time(choosetypeof screen0 or 1):
Seepage51 of COMALFromA To Z for setgraphic0 // <-- hi res
moreinformationaboutRENUM. setgraphic1 // <--multi-color
** How to storea programon disk Oncethescreenis chosen,you can flip
betweengraphicsand texteasilywith
Typethecommand(replacenamewiththe thefunctionkeys:
namethatyou wish to storetheprogram fl - flipsto the textscreen
as): f3 - flipsto the graphicsscreen
save "name" with text windowat top (calledsplitscreen)
** How to lista programon the printer fSL- flipsto the graphicsscreenn
Makesuretheprogramis in the
COMALUsersGroupUSALtd,6041MononaDr,Madison,WI53716,phone608-222-4432,page5 JustForBeginners
Whenyou arejuststartingwith firstis a basicprogramthatis usedto
computers,thingsseemveryconfusing. startCOMAL.The secondis theCOMAL
It becomeseasyonceyouunderstandwhat 0.14systemitself.Thethirdis the
is goingon.Remember,you arenot errormessagesusedby theCOMALSystem.
alone.All of us werebeginnersonce. Finally,HI is theCOMALprogramthat
runsautomaticallywhenCOMALstartsup.
TO LOAD or NOT TO LOAD Immediatelyafterthemnoticetheline:
Thereis one importantthingto ">—programs—<"
remember:you can'tloadeverythingon
thedisk.Somethingson thediskare Thatlinetellsyou thattheprograms
notmeantto be loaded.Theyare there comenext.Programfilesare theones
forotherreasons.The clue thata file thatyou canLOADandRUN likethis:
on thediskis not meantto be loadedis load"menu"
thedot (.)in itsname.We oftenrefer run
to thesenonloadingfilesas DATAFILES.
Seethechartof filenameconventions Or youmayuseonecommandthatis the
on page3 for examples. equivalentof both LOADand RUN at once:
chain"menu"
Lookat thedirectoryof our disks.We
tryto clearlyseparatethe filesthat You can see theCOMALERRORSfileis
areprograms(theonesyou canLOADand beforethe>—programs—< banner.It
RUN)fromthefilesthatarenot.For is separatedpurposelyso youwillnot
example,a partialdirectoryfromour try to LOAD it. The COMALsystemgets
AutoRun Demo Diskfollows: itserrormessagesfromthisfile.Thus,
errormessagescouldbe in Spanish,
AUTO RUN DEMO French,or anyotherlanguage,if an
"bootc64comal" appropriateerrormessagefilewere
ffc64comal0.14" createdand namedCOMALERRORS.
"comalerrors"
"hi" Finally,thefilesat theendof the
">—programs—<" directoryare preceded bythebanner:
"menu"
"Arabesque"
"> datafiles "Towersof Hanoi" "> follow <" "> datafiles <" "> follow <" Remember,datafilesare NOT programs. "> <" Do not tryto LOADthem.We groupthem "abc.sprite" togetherso thatwe may clearlymark "calculator.hrg" themas data files.CALCULATOR.HRGis "glady.hrg" amongthem.It is a picturefile.Read thediskdirectorycarefullyand you The firstfilesat the topof the won'thave problemstryingto LOADa directoryare theCOMALSystem.The filethatis notmeantto be loaded. More► page6,COMALUsersGroupUSALtd,6041MononaDr,Madison,WI53716,phone608-222-4432 !■■■■ JustForBeginners-continued It is easyto customizethe systemso MAKE A BACKUPCOPY - IT IS IMPORTANT thatit automaticallyrunsany COMAL "Howdo I makea backupcopy?",you ask. programyouwant!WhenCOMALstarts,the The answeris so importantthatwe've firstthingit doesis LOADandRUNthe includeda programon theProgrammers programnamedHI fromthe disk.You can ParadiseDiskthatwillbackupa disk changethe HIprogramto any COMAL foryou.See page20 for instructions. programyou like.Justnametheprogram you want to automaticallystartHI. Or, MAKEYOUR OWN COMALSTARTUPDISK ifyouwishto keepyourprogramswith theiroriginalnames,justmakea HI Manyuserswishto createa specialdisk programthatis merelyonelinelong: thattheycan useto startup COMAL.It 0010chain"start" wouldincludeCOMAL,the errormessage file,theSIZZLEfastloader,and theHI Replace"start"withthenameof your program.To createyour own COMALdisk, programyou want to be run first.Save get a blankdiskand put it intothe thisone lineprogramas "hi": drive.Issuethe formatcommand: delete"0:hi" save"0:hi FromBASIC: OPEN 15,8,15,"N0:DISKNAME,ID" NowwhenCOMALstartsup, it willload andrunyourHI program.ThentheHI CLOSE15 programwill loadand run the program withthenameyou chose!Automatically!|S) FromCOMAL: PASS"NO:DISKNAME,ID" DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD Usingthe SingleFileCopierprogram (instructionson page22) copythese ProgrammersParadiseFeatures COMALsystemfilesontothenew disk: bootc64 comal Thereareover40 differentdisksof c64 comal0.14 COMALprogramsavailable.We were hi surprisedthatourFONTDISKbecameone ml.sizzle of themostpopular.A "font"isthe comalerrors definitionofhoweachcharacteris displayedon yourscreen.Forexample, Thefirstprogramis a BASICprogram our"headline"usesHelveticafont.Our thatstartsup COMALforyou.Makesure addressat thebottomof thispageuses youuse thefilesfromtheProgrammers RomanTimesfont.TheVIEW'FONT/DEMO ParadiseDisksincetheyincludea programon theProgrammersParadiseDisk fastloader(theCOMAL0.14systemitself allowsyouto changethefontusedby hasnot changedsinceNovember1983when COMALto displaycharacterson your was released).Make surethatthe it screen.Of coursewe provideseveral bootprogramis the firstone on thenew alternatefontfileson thediskas disk.Thenyou canstartCOMALwith: well.Ifyoulikeit,we havedozensof otherfontsavailableon theFONTDISK, load"*",8 as wellas a FONTEDITORforCOMAL2.0 run thatlet'syoudesignyourownfont.H COMAL UsersGroupUSA Ltd,6041MononaDr,Madison,WI53716,phone608-222-4432,page7 WhatIsCOMAL? COMALhas anidentitycrisis.It is programscalledtheAutoRunDemoDisk. idealforbeginners andnon-professionalGetit nowandwe includetheBestOf programmers.But it is so powerfulthat COMALdiskas well! professionalprogrammersloveto use it. Andwithover3,000readyto runCOMAL If youwantonlythebest,a deluxe programsavailable,manyuseCOMALjust versionof COMALis availableas a fortheLOADandGO programs. cartridgefortheCommodore64.It has morememoryspace,morepower,and more CommodorehasjustannouncedthatCOMAL options.A powerfulversionfor the IBM is thethirdmostpopularlanguageused PC andMS-DOScomputersis also on itscomputers.Withover100,000 available.Sincetheseare imported, COMALusers,thatis to be expected. theirpricemay fluctuate. BASICandmachinecodeweremorepopular onlybecausetheycomewiththe COMALIS NOT COPY-PROTECTED! computer.OK,butwhatexactlyis COMAL? ThediskloadedCOMALfortheCommodore COMALIS SIMPLYTHE BEST. 64 maybe freelycopied.We giveyou permission!We wanteveryoneto knowand COMALis a sophisticatedcomputer loveCOMALas muchas we do. programminglanguagethatis powerful, yeteasy and funto use.WithCOMALyou WHY COMALWILL REPLACEBASIC canwriteyourown programs,complete withspritesandgraphics. *** COMALis FASTER WHO CAN USE COMAL? In 11 BenchmarktestsbetweenCOMALand BASIC,COMALwas fasterin everytest. YOU can!COMALis availableto run on It was 3 timesfasteroverall,and an manypopularcomputers,including amazing57 timesfasterin string COMMODORE64,IBMPC,MS-DOS,Commodore searches.IBMPC COMALis evenfaster 128,CommodorePET,CP/M,and soonApple thanTurboPascal(BYTEbenchmark). lie,Applelie,Macintosh,andAmiga. *** COMALis STANDARDIZED IS IT EXPENSIVE? A standardforCOMALexistscalledthe If youhavea Commodore64 withdisk COMALKERNAL.Thusas new COMALsystems drive,thecostis minimal.For only appear,they'llbe virtuallycompatible. $19.95(subjecttochange)yougetthe Programsyouwritetoday,you can run ProgrammersParadisePackage.This tomorrowon otherCOMALcomputers.For includesthecompletediskloadedC64 example,we usea largeCOMALprogramto COMAL0.14,theCOMALFromA to Z process ordershere.It was writtenfor referencemanual,a collectionof Commodore8096COMAL2.0.We transferred severalCOMALTODAYnewslettersand a it via modemto IBMPC COMAL2.0and it diskfullof demonstrationprograms.For ranafteronlymodifyingthefilenames only$5 moreyou geta doublesideddisk andonesubstringshortcutthatIBMPC whichincludestheinteractiveTutorial COMALdoesnot allow! SystemDiskand moredemonstration More► page8,COMALUsersGroupUSALtd,6041MononaDr,Madison,WI53716,phone608-222-4432 WhatIsCOMAL?-continued *** COMALis HELPFUL longerhave to purchaseLOGOto enjoy thishighlyacclaimeddrawingsystem. COMALcheckseachlineof yourprogram as you enteritI You are informed,with *** COMALis OFFICIAL understandableerrormessages,whenever you typein an incorrectprogramline. COMALis the official languagein COMALalsochecksoveryourentire Denmark,Ireland,Sweden,Scotlandand programbeforeit doesa RUN.Thistakes Norway.Sinceit is so easyto learn,it lessthana secondandinformsyouof an is idealfor schools. errorbeforetheprogramactuallystarts running.Thisis essentialto good *** COMALis STRUCTURED programtestingand is a featuresadly lackingin BASIC.Errormessagesare Structuredprogrammingmerelymeans automaticallyremovedfromthescreen simplifiedprogramming.COMALincludes whenyoucorrecttheerror. theprogramstructuresthatmadePascal popular.You no longerhaveto put up *** COMALis LITERATE withPascal'slimitationsand rigorous rulesto enjoystructuredprograms. COMALletsyouuse longvariablenames andnamedprocedures.To keepa running *** COMALincludesBASICkeywords total,no needto callthevariableT. CallitTOTAL.Andto usea pause You cancontinueusingmostof theBASIC subroutineinBASICyoumighthaveto languageyou mayalreadyknow,in an code: improvedenvironment. XP-4:GOSUB21500 *** COMALhas COLORGRAPHICS In COMALyou wouldsimplywrite: PAUSE(4) C64COMALincludesnearly50 keywords forgraphicscontrol. *** COMALHAS A GOODMEMORY *** COMALhas SPRITES Onceyouhavewrittena procedure,you cancallitby namefrom directmode. C64COMALincludeskeywordsfor Justlikeaddingyourownkeywords! controllingsprites.No morePEEKand POKEto createenjoyablegamesand *** COMALIS WELLDOCUMENTED educationalprograms.The cartridge versionhas twiceas manycommands, TheCOMALHandbook(479pages)documents includingeasyspriteanimation! COMALin an easyto use style.Excellent tutorialbooksarealsoavailable.Over *** COMALuses the FUNCTIONKEYS 16 differentCOMALbooksin all. C64COMALutilizesthe functionkeysfor *** COMALincludeseasyGRAPHICS easyaccessto the graphicsscreen,text screen,or splitscreen.Flipback and C64COMALincludestheTURTLEgraphics forthbetweenscreenswiththe touchof systemas popularizedby LOGO.You no onekey.The C64 COMAL2.0Cartridgeand COMAL UsersGroupUSA Ltd,6041MononaDr,Madison,WI53716,phone608-222-4432,page WhatIsCOMAL? -continued IBMPC COMALevenallowyou to redefine programsintoCOMALand continueusing thefunctionkeysyourself. thesamedatafiles,bothsequentialand randomaccess. *** Programlistings- EASY TO READ *** COMALis POWERFUL COMALautomaticallyindentsall structureblocks,makingprogram COMALis alreadyusedin Denmarkto listingsveryeasyto read. controlseveralairports.It is also usedin industrialcontrollersandwith *** COMALis easyto MAINTAIN specialinstrumentsin laboratories. ComputerAidedLearningsystemsare SinceCOMALallowsmodularprogramming, alreadyrunningin bothCanadaand completewithmulti-lineproceduresand Denmark,writtenin COMAL.SeveralData functions,it is easyto maintaina Basesare availablein COMAL.Accounting COMALprogram.And in serious Packages,Spreadsheets,and other programming,programmaintenanceis applicationsare currentlybeingwritten usuallymoretimeconsumingthanthe in COMAL. originalprogrammingtime. *** CONSISTENTand WELL DESIGNED *** NOT SLOWEDDOWNby remarks COMALbenefitsfromover10 yearsof Many magazinearticlesrecommendthat developement.It is not a seriesof you removeREMARKstatementsfroma "patches"to BASIC,but a well finishedBASICprogramto speedup its researchedand designedlanguage.COMAL execution.ThisBAD programmingpractice ig whatBASICshouldhavebeen. is totallyunnecessaryin COMAL. *** COMALIS AVAILABLENOW *** LONGVARIABLENAMES COMALis not a dream.It is a finished A longvariablenametakes upmore no product.Thereareover100,000COMAL programspacethana shortvariable usersalready.You should benext. name.COMALstoresyour program efficiently.Youarenotpenalizedfor *** HOW TO GET STARTED creatinga readableprogram. We put togetherespeciallyforC64 ***MERGEprogramsegmentstogether beginners,theProgrammersParadise Package($19.95).Makesureto getthe A builtin featureallowsyou to mergea optionalTutorialDiskfor$5 sincewe programsegmentfromdiskwiththe thenalsogiveyoutheBestOf COMALand programcurrentlyin memory. AutoRun Demodisksas well.If you want onlytheBEST,ordertheC64Deluxe ***ReadBASICdiskdatafiles COMAL2.0CartridgePackage.Rememberto addon shippingcosts($2minimum)and COMALcanreadandwritefilesin two use ourorderformto avoidconfusion.n ways:efficientlyin BINARYor theBASIC way in ASCII.Thusyou can convertBASIC page10,COMAL UsersGroupUSA Ltd,6041MononaDr,Madison,WI 53716,phone608-222-4432 DareToCompare Ifyoutakejusta momentto compare Lookingat thechartbelow,youmight programminglanguages,youwillseewhy wonderwhy so manypeoplestilluse COMALis thenumber1 languageof choice. BASICwhenit doesn'thavemanyextra BASICandMachineLanguagearemore features.You are invitedto joinover popular- butthatisbecausetheycome 100,000COMALusers.Choosethe language withthecomputer.A quickglanceat the thatwillbe thenextstandard.Choose comparisonchartbelowshouldconvince COMAL.The ProgrammersParadisePackage you - COMAL0.14is preferableover makesstartingeasy.Calltoday.We can BASIC,andtheCOMAL2.0Cartridgeis quicklysendyou thepackage.(H evenbetter,perhapstheBESTbarnone! ComparisonChart x = included x = included x = included -= notincluded -= notincluded -= notincluded ^EDITING======/=INPUT-OUTPUT-PRINTER==^GRAPHICS======xx-AUTO-automaticlinenumbers xx -TAB worksonprinterasonscreen xx-TurtlegraphicsandX/Ygraphics x x-RENUM -renumberlines x x-Variablesizeprintsones x x-Hi-resormulticolorgraphics x x-MERGE fromdisk xx-Printzone-sameonprinter/screen x x-Splitscreen(text/graphic!) x x-Syntaxcheckingonentry x --Setupdefaultprintertypes xx-Background/Bordercolorkeywords x x-Deleteblocksoflines x --Builtingraphicscreendump xx-Mixtextandgraphicsonscreen x--FINDandCHANGEcommands x --Builtintextscreendump x --Graphicstextinanysite x x-Pauseaprogramlisting xx-PRINTUSINGformattedoutput x --Graphicstextsideways x--TRACE-fordebuggingyourprogramxx -Selectoutput:printerorscreen x --Saveagraphicsscreentodisk x--'Quotemode1disable/enable x--Selectinput:keyboard/batchfile x --Windowcapabilities x--UnderstandsUPPERandlowercase x --INPUTAT andPRINTAT xx -Lineclippingwithinframe x--Erasetoendofline-CONTROLK x --Automaticprotectedinputfields x --ARC andCIRCLEcommands x --Ooopskey-CONTROLA x x-Allowsnullreplytoinput x x-FILLcommand ==FILES======x x-AllowsSTOPkeyduringinput xx -PLOT apoint xx-Binarysequential/randomfiles x x -Allowscommaaspartofinput ==SOUND====== xxxASCIIsequential/randomfiles x --Userdefinablecharacterfonts x --BELLcommand xx -Easyonecommandrandomfileuse ==STRUCTURES======x --Builtinsoundcommands x -x GET fromdisk xxx FOR loop x --Controlsoundenvelope x--BuiltintrueASCIIconversion x x-IntegerFOR loop x --Interruptdrivenmusicbuiltin ==DISKCOMMANDS—======xx -REPEAT...UNTILloop ==MACHINELANGUAGE===== x x-CAT-catalogoffilesondisk x x-WHILE...ENDWHILEloop xxx Callmachinecoderoutines x--Pausecatalog-sendittoprinter x --LOOP...EXITloop x --Callmachinecodebyname xx -STATUS-statusofthediskdrive x x-CASEstructure x --Linkmachinecodetoprograms x--COPY-copyfilescommand xx -IF THEN ELSE-multiplelines x--M/Lroutinesparameterpassing x x-DELETE-scratchfilesfromdisk xx -Callroutinesbyname ==OTHER======: x--MOUNT -initialiseadisk x --External proceduresandfunctions x --Modemcommunicationsbuiltin x--RENAME adiskfile xx-Multiplelineprocedure/function xx -Functionkeysdefined x x-KnowswhenEndOfFileisreachedxx-Parameterswithprocs/fiincs x --Functionkeysalterablebyuser xx -CHAINoneprogramtoanother xx -LOCALorGLOBALvariables x x-Stopkeydisable/enable ==NUMBERS======x --ERROR HANDLER -traperrors x --Cursorcommand x --AcceptsHexandBinarynumbers xx -Automaticindentingofstructures x x -No"garbagecollection" x -xIncludesLogicalAND andOR ==SPRITES======x--Joystick/paddle/lightpenkeywords x --IncludesLogicalXOR x x-Keywordsfordefiningsprites xx -Builtinstringsearch-IN xxx IncludesTrigfunctions x x-Keywordsforsettingspritecolor x --Storeatextscreenforlateruse xx -UnderstandsTRUEandFALSE x x-Keywordformovingsprites x x -Longvariablenames x x -DIVandMOD operators xx -Builtincollisiondetection x --CansenseSRQinterrupt x x-Arrayswithanyminimumindex x --STAMP aspriteimageontoscreen x x-Canchangepartofastring xxx Integernumbers x --Animatesprites,interruptdriven x --Builtinclearscreencommand x x-Producerandomintegerinarange x --Attachspriteshapestoprograms xxxPEEK,POKE,SYS,GOTO ■ COMALUsersGroupUSALtd,6041MononaDr,Madison,WI53716,phone608-222-4432,page11 QuestionsandAnswers QUESTION:WhatcomputerscanrunCOMAL? TIME.It evenhas featuresyouwould ANSWER:Commodore64, Commodore128, onlyexpectwith the largestcomputers PET,CBM8032,CBM8096,MS-DOS,andIBM including:externalproceduresand PC computers.Europeandistributorsalso functions,a structurederrorhandler, haveCOMALforCP/M,APPLEwithCP/M protectedINPUTfields,userdefined card,ACORNElectron,BBCMICRO,Compis, stringfunctions,windows,a builtin Scandis,Supermax,Unix,RC Piccolo, RC spriteanimationsystem,soundcontrols, Partner,andmore.PlusseveralEuropean and FINDand CHANGEcommands. computershaveCOMALbuiltin.We expect COMALfor theMacintosh,AppleHe, QUESTION:What aboutIBM PC COMAL? AppleHe, Amiga,andAtariST soon. ANSWER:IBM PC COMALproducedby IBM Denmarkis writtenby UniComal,the same QUESTION:DoestheinexpensiveC64 COMAL people whobroughtus C64 COMAL.The IBM 0.14includemuch? versionis a much more seriousand more ANSWER:Don'tlet thepricefoolyou. powerfulversion.Althoughthe systemis Comparingit to BASICis likecomparing in English,themanualis in Danish.We a ModelT to a RollsRoyce.C64COMAL arepatientlywaitingfortheEnglish 0.14is packedwithbuiltin features manualpackagebeforepromotingit much including:ProgramStructureswith in theUnitedStates.But we do use it AutomaticIndentation,FullScreen extensivelyourselves.Our order programediting,Mergingprogram processingsystemrunsunder IBMPC segmentsfromdisk,Automaticline COMAL,as doesour accountingand numbering,Line renumbering,Program inventorycontrolsystems.Anyone chaining,Multilineproceduresand familiarwithCOMAL2.0on theCommodore functionswithparameterpassing,Local 64 willhaveno problemusingtheIBM variables,Stopkeydisable,End Of Dataversion.Eventhe fullscreeneditingis andEndOf Filesystemvariables,Built alike!Thepricefluctuatessince we in StringSearch,ImmediateSyntax importit fromDenmark.Callto verify Checking,builtin RunTimeCompiler, thecurrentprice. andmuchmore.It leavesabout12K free workspaceon theCommodore64 (equals QUESTION:Do you put out a newsletter? to about18K ofBASICprogramwork Do you havemembershipsto yourgroup? space).If thatisn'tenough,it also ANSWER:OurCOMALTODAYnewsletteris includesa LOGOcompatibleturtle thesourceof up to dateinformation graphicsdrawingsystempluseasyto aboutCOMAL.Contributionscomefrom manipulatesprites. leadingCOMALexpertsas wellas users world-wide.Membershipis not currently QUESTION:DoestheCOMAL2.0 Cartridge available,but a subscriptionto COMAL domorethanthediskloaded COMAL? TODAYis virtuallythe samething. ANSWER:Yes,muchmore.It has over 30K freeusermemory,PRINTAT,CURSOR,LIST QUESTION:Are your diskscopyprotected? procedure,addeddiskcommands,both ANSWER:AbsolutelyNOT!Unlikeother upper andlowercaselettersacceptedon languages,ourC64disksarenotcopy programentry,GET$,GLOBALvariablesin protected.You may make as manybackup a CLOSEDprocedure,INTERRUPTmonitoring copiesas you like.If you market theIEEEinterruptline,STR$,VAL,and programswrittenin C64 COMAL0.14,you More► page12,COMALUsersGroupUSA Ltd,6041MononaDr,Madison,WI53716,phone608-222-4432 QuestionsandAnswers-continued can includetheCOMALsystemon the disk andtheseare includedin bothC64COMAL withyourprogramswithoutany royalty andIBMPC COMAL.COMALis thenatural payments. firstlanguageto learn.In fact,it is thefirstlanguagetaughtin Ireland, QUESTION:Can COMALcommunicatevia Sweden,Norway,Scotlandand Denmark. modem? ANSWER:YES! SeveralCOMALTerminal QUESTION:How aboutsampleprograms? programsareavailableon ourModem ANSWER:Over3000programsareavailable Disk.The COMAL2.0Cartridgehas on morethan40 differentdisks. telecommunicationcapabiltybuiltin. QUESTION:Can a BASICor LOGOprogram QUESTION:Is a COMALcompileravailable? run underCOMAL? ANSWER:All versionsincludea Run Time ANSWER:NO.However,it canbe rewritten Compiler,with manyof theadvantages.A to do so. Likewise,BASICand LOGO truecompileris not yetavailable. cannotrun a COMALprogram. However,IBMPC COMALis fasterthan TurboPascaljustas itis now! QUESTION:Is COMALCommodoreApproved? ANSWER:Yes!It is approvedby Commodore QUESTION:Is COMALfasterthanBASIC? England.CommodoreCanadaintroducedit ANSWER:Muchfasterin all respects!A at theWorldof CommodoreShow7giving programwillrun about3 timesfaster awayover500COMALdisksin twodays. thanan equivalentBASICprogram.Write The COMALHandbookis approvedby yourprogram3 to 10 timesfasterand CommodoreUSA.And the COMALCartridge fixanyerrors3 to 10timesfasteras is manufacturedby CommodoreDenmark. well.Stringsearchesareactuallyover COMALis official.It alsohas been 50 timesfasterwithCOMAL.You do not awardedtheUnitedStatesCommodore sacrificespeedto gainCOMAL UsersGroupEndorsement(onestephigher advantages. thanApproval).Officialdistributorin theUSA is COMALUsersGroupUSA QUESTION:How about soundcontrol? Limited.IBMPC COMALis alsoofficial, ANSWER:Soundcantrolcommandsarebuilt producedby IBM Denmark. intotheCOMALCartridge.COMALTODAY haspublishedroutinesforusewith QUESTION:Willa standardCOMALprogram COMAL0.14(onTODAYDISK#S)/ I writeon my Commodore64 runwith IBM COMAL? QUESTION:Do you recommendthatstudents ANSWER:Yes.We use a systemof COMAL startwithCOMALandprogressto LOGOor programsto processordershere.They BASIC? werewrittenon a Commodorebut now are ANSWER:Yes!By allmeansstartwith runningon anIBM PC compatiblewith20 COMAL.But NO! LOGOand BASICare not Meg Harddisk.We onlyhad to changethe neededonceyou are usingCOMAL.BASIC filenamesand removeone shortcut in is a stepbackwardsandwill onlygive substringsthatCommodoreallowsbut IBM studentsbadhabitsto UNlearnlater. doesnot. IB) AndCOMALincludesvirtuallyallof BASIC,withoutitshassles.LOGOis usuallychosenfor itsTurtleGraphics- COMAL UsersGroupUSA Ltd,6041MononaDr,Madison,WI 53716,phone608-222-4432,page13 Letters SOMEOF OUR TYPICALLETTERS: * Ifvebeenwritingcompilersand operatingsystemsforNCR fora number * Froma Commodore64 publication:C64 of yearsandI'mtotallyamazedat COMAL0.14mightbe theproductof the COMAL.Thisis trulyan exceptional year.In my opinion,it is superiorto language.L.F. Simons1Basicforgraphics! * I now own 'every1languagethatthe * As a longtimeprogrammerin BASIC, Commodore64 has...COMALseemsto be Assembly,andotherlanguages,I am thebestoveralllanguageby a long speechless.COMAL0.14doesindeedmake shot.R.G.Ohio BASICobsolete...itis theclearest languageI haveeverused.J.S.Illinois * I havejustreceivedmy COMALdiskfor theCommodore64,version0.14.I find * Beinga collegeseniorin Computer thislanguageabsolutelyfascinating.I Science,I havebeenexposedto many teachcomputerprogrammingforgifted fineprogramminglanguages,includingC, children...M.B.Pennsylvania Ada,andPascal...As a scientist,I am impressedwithitscontrolstructures, * I'vehadsecondthoughtsaboutmy C64 readability,modularity,and in thepast(itsBASICis thepits!), maintainability.As a student,I am butwithCOMAL- no more.It isan impressedwith itsprice...B.P.Maryland unbeatableprice/performance combination.C.N.Ohio * ...it seemsthatCOMALis exactlywhat I havebeenwaitingfor.W.C.Delaware * Nicelanguage!!SurehasBASICbfcat!! D.H.California * Turtleand Spritecommandsallworkin program andinteractivemodesand far * I havebeenusingCOMALsinceOctober exceedexpectations.R.H.Montreal 1983ona C64andI getmoreenthused aboutthislanguageeverytimeI useit. * I am in lovewithCOMAL.I havebeen N.A.California usingBASICfor aroundfiveyears.It serveditspurposebut now it is timeto * AfterhavingplayedwithCOMALon my moveon to somethingbetter(nowthatit C64thepastfewdaysI canhonestlysay has arrived).R.J. Iowa I am absolutelyamazed!It reallydoes seemeasyto learn...C.G.Wisconsin * I thinkCOMALis the best language availabletoday!F.K. * I justreceivedtheCOMAL0.14from youa weekagoand it is great.I have * I havethe0.14versionon diskand am usedPascalin my job and it appears reallyastoundedby itspower.A.W. thatCOMALhassomefeaturesPascaldoes not.B.C.NorthCarolina * Itis easyto understandyour interest in COMAL.Whatan excitinglanguage. The* As a languagetyro[Forth,Logo, factthatso manyfeaturescouldbe put Pascal,Pilot,Fortran,Cobol]I cansay in a homecomputerlanguageis amazing thatCOMAL'sthebestlanguageI'veseen to me.K.G.Utah formicro's.D.V.MarylandH page14,COMALUsersGroupUSA Ltd,6041MononaDr,Madison,WI53716,phone608-222-4432 COMALBooks Thereare16COMAL booksavailablenow, CartridgeGraphics& Sound GraphicsPrimer andmanymoresoontobereleased.A CaptainCOMAL'sFriends MindySkelton categorylistingofthebooksisbelow. SeeCOMAL TODAY #7 forfullreviews.GeneralCOMAL Tutorials CaptainCOMAL GetsOrganized LenLindsay BeginningCOMAL COMAL 0.14& 2.0Reference: BorgeChristensen COMAL 2.0Tutorials COMAL Handbook FoundationsinComputerStudies COMAL 80TutorialBinder LenLindsay WithCOMAL FrankBason& LeoHojsholt JohnKelly COMAL 0.14Reference: OtherCOMAL Books StructuredProgrammingWithCOMAL COMAL FromA To Z RoyAtherton LibraryofFunctions BorgeChristensen KevinQuiggle StartingWithCOMAL C64GraphicsWithCOMAL IngvarGratte COMAL Yesterday LenLindsay ReprintofCOMAL Todayissues1-4 COMAL 0.14Tutorials COMAL 2.0Reference: COMAL Quick& UtilitesSet2 COMAL Workbook JesseKnight COMAL 2.0Packages GordonShigley JesseKnight TOP 10BESTSELLINGCOMAL BOOKS IN1985 1985! Book !Jan!Feb!Mar!Apr.'May!Jun!JulIAug!Sep!Oct!Nov!Dec! 1 *! COMALFromA To Z ! 2 ! 2 ! 3 ! 5 ! 4 ! - ! 1 ! 1 ! 1 ! 1 ! 1 ! 1 ! + + + + + + + + + + + + + + 2 ! COMALHandbook ! 1 ! 1 ! 1 ! 3 ! 3 ! 2 ! 4 ! - ! 5 ! 4 ! 5 ! - ! + + + + + + + +— + + + + + + 3 *! CartridgeGraphics& Snd!3!3!2!4!5!3!2!4!3!3!3!3! + + — + — + — + — + ---+ — + — + — + — +—+— + + 4 @! CartridgeTutorialBindr!- ! - ! - ! - ! - ! 1 ! 3 ! 3 ! 2 ! 2 ! 2 ! 2 ! + + +— + — + — + — +—+— +— +— + — +— +— + 5 @! BeginningCOMAL ! - ! 4 ! 1 ! 1 ! - ! 4 ! 5 ! - ! - ! 5 ! - ! - ! + + — + — + + +— + — + — + — + •+— +—+— + 6 *! COMALWorkbook ! - ! - ! - ! - ! 1 ! 5 ! - ! 2 ! 4 ! 5 ! 4 ! 5 ! + + — + — + — + —+ +—+ — + — +— + — + — + + 7 *! COMAL2.0Packages ! - ! - ! - ! 2 ! 2 ! - ! - ! - ! - ! - ! - ! - ! + + +— + — + — + — + —+— + +— + — + — + + 8 @! Foundations...withCOMAL!5 ! - ! 4 ! - ! - ! - ! - ! - ! - ! - ! - ! - ! + + — + — + + +— +—+ — + — + +— +— + + 9 @!Structured...withCOMAL! 4 ! 5 ! - ! - ! - ! - ! - ! - ! - ! - ! - ! - ! + + — + — + — + —+ + — +— +— + — + — + —+ + 10 ! COMALYesterday ! - ! - ! - ! - ! - ! - ! - ! - ! - ! - ! - ! 4 ! + +—+—+—+—+—+—+—+—+—+—+ — + — + * meansthisbookis a CaptainCOMALseriesbook @ meansthisbookis imported H COMALUsersGroupUSALtd,6041MononaDr,Madison,WI53716,phone608-222-4432,page15 1)InsertyourCOMALdiskindrive*. 2)TypeLOAD"064COMAL*",8 3)TypeRUN (startsCOMAL) 4)TypeAUTO (turnonautoline#ls) 5)Entertheprogramlinesshownbelow GraphicsDesigner 6)HitRETURN keytwicewhendone 7)TypeRUN 0010,IIsave"design"//incomal 0020repeat 0030 design by CaptainCOMAL 0040untildone 0050II Whome?A designer?Now,an artistI'mnot.But look 0060procdesign 0070 black:=0;white:=l at whatI created(witha littlehelpfromCOMAL).And 0080 backgroundblack it only tooka fewminutesto writetheprogramthat 0090 pencolorwhite makesthe design.Bestof all,you can use the program 0100 setgraphic0//highresscreen 0110 //pickrandomnumber& size as a startingpoint.The hardestpartof learningto 0120 number'boxe8:=md(6,36) programis starting!I learnedto programon my own 0130 box'sise:=rnd(10,60) 0140 forboxes=ltonumber'boxesdo yearsagoby lookingat otherpeoplesprogramsand 0150 box(box'sise) thenchangingthem. 0160 left(360divnumber'boxes) 0170 endforboxes 0180endprocdesign Now,how wouldyou drawa box?Drawa lineand turn90 0190II degrees.Thendo that3 moretimesfor allfoursides: 0200procbox(length) 0210 forsides:=lto4 do 0220 forwardlength SETGRAPHIC0 0230 left90 FORSIDES-1TO 4 0240 endforsides FORWARD20 0250endprocbox 0260 LEFT90 // 0270funcdone ENDFOR 0280 plottext8,8,"doanother?" 0290 whiletruedo//forever 0300 casekey$of Thatwilldrawa box on yourgraphicsscreen(the 0310 when"Y","y" firstlineputsyou in graphicsmode).Try it.Now, 0320 returnfalse thefunpart.Let'sgive thosefourlineswe just 0330 when"N","n" 0340 returntrue wrotea name.Let'scallthemBOX.Justadd a header 0350 otherwise litmabovethem,andan endinglineafterthem: 0360 borderrnd(0,15)//Hash 0370 endcase PROCBOX 0380 endwhile 0390endfuncdone ••••• ENDPROC Now,onceyourprogramis run,COMALknowswhatyou meanif you givethe commandBOX.But alwaysdrawinga size20 box getsboring.Let'sadda parameter!When we wanta box,we willtellhow big at the sametime: Noticehoweasyitistomakeadesign usingthebuiltinturtlegraphicsof BOX(30) COMAL.Line220drawsalineandline 230turnstheturtletoprepareforthe nextlinedrawn.Settingthescreencolors ChangeyourBOXprocedureto looklikeit doesin the isequallyeasyasseeninlines70-90. programlistingon the side.Now you can makeboxes Randomnumberscanbeproducedwithin anyrange(lines120and130).COMAL any sizeyou want.The procedureDESIGNdrawsa series alsounderstandsTRUE andFALSE. of BOXESat differentangles. * Ifyoudon'thaveCOMAL yet,ordera Programmer'sParadisePackage-$19.95. Finally,I definedmy own functionnamedDONE. It ItincludesthecompleteCOMAL system showshow a functioncan includemanylines,and even plusover400pagesofinformation.Add askyouquestions(muchdifferentthanthe 1 line $5moretogetour20interactivelesson TutorialDisk.Add$2shipping.Visa/MC functionsof BASIC). orUSfundscheckaccepted.H page16,COMAL UsersGroupUSA Ltd,6041MononaDr,Madison,WI 53716,frhone608-222-4432 1)InsertyourCOMALdiskindrive*. 2)TypeLOAD"C64COMAL*",8 3)TypeRUN (startsCOMAL) 4)TypeAUTO (turnonautoline#>s) 5)Entertheprogramlinesshownbelow ElectronicPhonebook(COMALindentslinesforyou) 6)HitRETURNkeytwicewhendone 7)TypeRUN e=enterf=findl=list Whatname?COMAL by Captain COMAL COMAL UsersGroup 608-222-4432 0010sone21 //setautotabto21 I'mlate!I bettercallGeorge.Drat!What'shislast 0020dimname!of20,phone!of12 name?Klaverston.No.Calverson?Wait!Whybother?You 0030dimdisk$of 2 havea computer.COMALis goodat searchingfor 0040black:=0;white:=l;yellow:=7 things.Thisprogramdoesit all foryou:createsthe 0050backgroundblack 0060repeat datafile,let'syouenternamesintoit,andbestof 0070 pencolorwhite all- findsa phonenumberwhenyouneedit.Andyou 0080 print"e=enterf=findl=list" don'thaveto rememberthepersonsfullnameeither! 0090 casekey!of 0100 when"e","E" 0110 enter'name Thefindroutineis simple.It is reallydoneallin 0120 when"f","F" onelineusingIN (seeline440).Thenicethingis 0130 input"Whatname?":name! 0140 find'name(name!) that INlooksovertheentirestringfora match!To 0150 when"1","L" findthenameGeorgeGalvestonyoucouldaskfor 0160 find'name("") Georgeand it wouldmatch.Or ask forGalv.ston.or 0170 otherwise 0180 printchr$(147)//dearscreen just£. Theyallwillmatch. 0190 endcase 0200untirtrue=false//forever Andkeepingtrackof yourdiskfileswithCOMALis 0210// 0220procenter'name easytoo.TheSTATUScommandreportson thestatusof 0230input"Entername:":name! thediskdrive(seeline300).We useit to seeif 0240input"Enterphone:":phone! openingthe filewas OK ("00").The firsttimeyou run 0250ifname!>""thenadd'toTile 0260endprocenter'name theprogramthedatafilewillnotbe there,andthe 0270// programdetectsthisand startsit foryou.COMAL 0280procadd'to'file watchesallyourfilesforyou.Wheneveryoureachthe 0290 openfile2("phone.dat",append 0300disk!:=status! endof a fileit setsEOF (forfindOf File)to TRUE. 0310ifdisk!<>"00"then By usingEOF in line420 we makesureour programis 0320 close//datafilenotfound notupsetif it can'tfindthepersonrequested. 0330 openfile2,"phone.dat",write 0340 endif 0350writefile2:name!,phone! Did you see the ZONEcommandin line10? In BASICyour 0360 close screenis setup witha defaultzonewidthof 10, 0370endprocadd'toTile 0380// whichis nice,if youhappento needthatspecific 0390procfind'naxne(search!) setting.In COMAL,you cansetthezoneto be any 0400 pencoloryellow numberyouwish (0 is thedefaultfornone).Line10 0410 openfile2,"phone.dat",read 0420whilenoteof(2)do setsthezoneto 21,perfectforusewithnamesup to 0430 readfile2:name!,phone! 20 characterslong(whichwe setin line20). 0440 ifsearch!inname!then 0450 printname!,phone! 0460 endif Finally,lookat themultiplechoicesystemCOMALhas. 0470 endwhile Lines90 through190showtheCASEstructure.KEY$ 0480 close looks atthekeyboardandreturnsthekey youjust 0490 print"Hit routineis executed.Whenit is F theprogramfirst * Ifyoudon'thaveCOMAL yet,ordera Programmer'sParadisePackage-!19.98. asksfora pieceof information(whatto lookfor)and ItincludesthecompleteCOMAL system thencallstheroutineFIND'NAMEto do thesearch.If plusover400pagesofinformation.Add noneof theWHENcasesmatch,COMALprovidesus with !5moretogetour20interactivelesson TutorialDisk.Add!2shipping.Visa/MC theOTHERWISEsection.All quitereadable. orUSfundscheckaccepted.■ COMAL UsersGroupUSA Ltd,6041MononaDr,Madison,WI 53716,phone608-222-4432,page17 1)InsertyourCOMALdiskindrive1". 2)TypeLOAD"C64COMAL*",8 3)TypeRUN (startsCOMAL) Ready,Aim,Draw 4)TypeAUTO (turnonautoline#fs) 5)Entertheprogramlinesshownbelow. LinesareindentedbyCOMAL automaticallywhenyoulistthe program.Ignoreleadingspaces whiletypingintheprogram. by CaptainCOMAL 6)HitRETURNkeytwicewhendone 7)TypeRUN Oh no!Not anotherdrawingprogram.Yes,dearreaders. 0010setup We arehappyto presentREADYAIM DRAW.Whilethe 0020repeat programdoesn'tcomecloseto the commercialdrawing 0030 aim 0040untiltrue=false//forever programsor our own GRAPHICSEDITORsystemscheduled 0050// forCOMALTODAY#22,it doesshowyou how you can 0060procsetup combine spritesand drawingon the graphicsscreen.It 0070 black:=0;white:=l 0080 backgroundblack showshow evensmallprogramscan do this. 0090 pencolorwhite 0100 repeat The programstartsby settingup things(aptlynamed 0110 input"speed(1-9):":speed 0120 untilspeed>0andspeed<10 SETUP).You shouldgetusedto groupingpartsof your 0130 setgraphic0 programintosmallmodules.Give eachmodulea name 0140 hideturtle (upto 78 characterslong).Fromthenon,wheneveryou 0150defme'shapefl) 0160 identify1,1 wantto executethelines,justcallthemby name. 0170 spritecolor1.white Anyway,ourprogramusestheSETUPmoduleto setthe 0180 spritesisel,true,true screencolors,definethe sprite,givedirections,and 0190 xpos:=100;ypos:=100 0200 plottextllllNcrsr=moved=drawtt askwhatspeedto use.To definethe spriteshapeit 0210endprocsetup callsanothermodule,DEFINE'SHAPE(seeline150). 0220// 0230procdefine'shape(num)closed 0240dimshape!of64 We usethebuiltin DEFINEcommandto definea sprite 0250 forx:=lto64do shape.Thatshapeis setupby a 63 characterstring- 0260 ifnoteodthenreadtemp plusa 64thcharacterthattellswhetheror not it is 0270 shape$(x):=chr$(temp) 0280 endforx highresolution.OurprogramusesDATAstatementsto 0290 data24,0,0,24,0,0,231,0,0 providetheproperstringcharacters.But notice,we 0300 data231,0,0,24,0,0,24,0 don'thave63 numbers.We onlyuse thenumbersneeded 0310definenum,shape$ 0320endprocdefine'shape to setup thetopcornerof thesprite.Thatis allwe 0330// need.Therestof thestringis setto CHR$(0)meaning 0340procaim blank.To do thiswe watchfor the End Of Data (EOD). 0350 spriteposl,xpos,ypos 0360 casekey$of WhenEODbecomesTRUE,we knowwe havereadthe last 0370whenchr$(145)//crsrup number,and don'treadanymore (justcontinueusing 0380 ypos:+speed thelastnumberread,whichis 0). 0390whenchr$(17)//crsrdown 0400 ypos:-speed 0410whenchr$(157)//crsrleft COMALunderstandswhatTRUEandFALSEmean.The 0420 xpos:-speed programusesthemin line180 to set thespritesize 0430whenchr$(29)//crsrright 0440 xpos:+speed to be expanded.Alsoline 40usesthem.Theprogram 0450when"d","D"//draw continuesto AIM untilTRUEequalsFALSE(whichis 0460 drawtoxpos+8,ypos-5 never).To stoptheprogramjusthit theSTOPkey! 0470 otherwise 0480 spritecolorl,rnd(l,15) 0490 endcase Meanwhile,theAIM modulechecksthekeyboard.€*ressa 0500endprocaim cursorkeyandthesmall crosstargetis moved * Ifyoudon'thaveCOMALyet,ordera accordingly.PresstheletterJ)to drawa linefrom Programmer'sParadisePackage-!19.95. thelastpointto thepointyou are currentlyaiming ItincludesthecompleteCOMAL system at.Otherwisetheroutinekeepschangingthecolorof plusover400pagesofinformation.Add $5moretogetour20interactivelesson thesprite,givinga pulsingeffect. TutorialDisk.Add$2shipping.Visa/MC orUS fundscheckaccepted.IB page18,COMALUsersGroupUSALtd,6041MononaDr,Madison,WI53716,phone608-222-4432 1)InsertyourCOMALdiskindrive*. 2)TypeLOAD"C64COMAL*",8 S)TypeRUN (startsCOMAL) 4)TypeAUTO (COMALprovidesthelinenumbers) TheWalker 5)Entertheprogramlinesshownbelow (COMALindentslinesforyou) 6)HitRETURNkeytwicewhendone 7)TypeRUN Watchananimatedspritehobble acrossthescreen.Changethe(99) by CaptainCOMAL inline450forreallyfastwalking 0010setup Thereis no needto be frightenedof sprites.COMAL 0020repeat addssimplecommandsto easilycontrolall8 sprites 0030 walking at once.WALKERis a simpleprogramthatanimatesa 0040untilkey$="q"//QtoQuit spriteusing4 shapes.Trytheprogram.Watchthe 0050// 0060procsetup WALKERhobbleacrossthescreen.COMALis so fastthat 0070 blue:=14;pink:=10 a pauseroutineis addedto slowthe WALKERdown. 0080 white:=l;black:=0 0090 define'images 0100 repeat Thewholeprogramismerely4 lineslong.Well, 0110 input"speed(1-10):":speed actually moreif you countalltheprocedurestoo.It 0120 untilspeed>=landspeed<=10 takesadvantageof COMAL1smodularnature,andsetsup 0130 backgroundblack 0140 setgraphic0 proceduresto performthe severalroutinesneeded.The 0150 spritebackblue,pink firstoneis calledSETUP.As youmightguessit sets 0160 spritecolor1,white up thingsfortheprogram.Beforesettingup the 0170 spritesisel,false,false 0180 plottextl,l,ttpressq toquit" spritecolorsand sizetheSETUPprocedure,calls 0190endprocsetup DEFINE'IMAGES.Now,thatis wherethe spriteshapes 0200// 0210procdefine'imagesclosed aredetermined- all four ofthem. 0220dimshape!of64,c$of1 0230shape$(l:64):="" Spriteimages aredefinedby a 63 bytestring,justas 0240 shape$(64):=chr$(l)//multicolor in BASIC.ButCOMALdoes allthework.DEFINEputsthe 0250c$:=chr$(0) 0260forx=22to63doshape$(x):=c$ imagesin a specialreservedareaof memoryforyou! 0270c$:=chr$(170) No PEEKor POKEneeded.ThenIDENTIFYletsany sprite 0280forx=lto21doshape$(x):=c$ use anyof thedefinedshapesat any time,even 0290define0,shape! 0300c$:=chr$(20) simultaneously.Butwhyusea 64 bytestringto DEFINE 0310forx=22to42doshape$(x):=c$ ourshapes?Only63 arefortheshapeitself!If the 0320define1.shape* 64thbyteis a CHR$(0)it tellsCOMALthatthesprite 0330defineS,shape$ 0340c$:=chr$(60) isHi-Res.Otherwisethespritewillbe Multi-Color 0350forx=43to63doshape$(x):=c$ (likein thisprogram).Lines150-170showhoweasyit 0360 define2,shape* is to setup thecolorsfor oursprites,as wellas to 0370endprocdefine'images 0380// chooseto expandtheirsize. 0390procwalking 0400 forwalk:=lto319divspeeddo 0410 x:=walk*speed Therestof theprogramisa simpleREPEATloop.It 0420 y:=100+walkmod4 continuesWALKINGuntilyou presstheQ key.WALKING 0430 spriteposl,x,y keepsmovingour spriteacrossthescreenwhile 0440 identifyl.walkmod4 animatingthe images.SPRITEPOSin line430 changes 0450 pause(99) 0460 endforwalk itspositionwhile IDENTIFYin line440givesit an 0470endprocwalking image.Thenline450pausesa bit.Changethe(99)to 0480// 0490procpause(delay)closed somethingsmallerfora shorterpause.Removetheline 0500 forwait:=ltodelaydonull altogetherforsomereallyfastwalking. 0510endprocpause youdon'thaveCOMAL yet,ordera Finally,noticetheuse of MOD in lines420and440. *If Programmer'sParadisePackage-!19.95. It doesa divisionand throwsawaytheanswer.The ItincludesthecompleteCOMAL system onlythingit remembersis theremainder.Thus9 MOD 4 plusover400pagesofinformation.Add $5moreto getour 20interactivelesson is 1, theremainderof 9 dividedby 4. Thisis a TutorialDisk.Add$2shipping.Visa/MC convenientway to haveimagescycleby fours. orUSfundscheckaccepted.B COMAL UsersGroupUSA Ltd,6041MononaDr,Madison,WI 53716,phone608-222-4432,page19 BackupYourDisks Don'tusethediskswe sendyou!As a If you haveonlya singledrive,you matterof fact,don'tuse thedisksthat stillcanbackupour disks.Sinceour any companysendsyou. First,backupthe disksareNOT copyprotected,anydisk disk.Thenstoretheoriginaldiskin a backupprogramwillwork.Use thebackup safeplace.Finally,usethecopyof the programyou alreadyhave.If you do not disk."Whybother?"youmayask.Well, havea diskbackupprogram,we are if foranyreasonthediskis ruined, providingone foryou on theProgrammers simplygetouttheoriginaldiskand ParadiseDisk.Sincemaximummemoryis makeyourselfanothercopy. neededto backupa disk,the program suppliedis a BASICprogram.Do not try OK,therearemorereasonsto makethose to loadit intoCOMAL.Do this: copies.One is compatibility.Thereare at least threevariationson thepopular 1) Removeany diskfromyour drive. Commodorediskformat:1541,4040and MSD.Theyeachcanreadtheotherformat 2) Turnoff the computersystem. types,thustheyareREADcompatible. However,theyareNOT WRITEcompatible. 3) Turnon thecomputersystem. Ifyouusea 1541driveto writeon a diskthatwascreatedwitha 4040drive 4) InserttheProgrammersParadiseDisk you are askingfor trouble.Problems intoyour drive.Usingunshifted willnotariserightaway.Butoneday - letterstype inthiscommand ZAP.You willhavemissingfiles!Avoid followedby theRETURNkey: theheartache. load"backupdisk.basic",8 Manyof ourdisksnow comewithprograms 5) Typethislinefollowedby RETURN: on BOTHsides.Sincewe onlyuse premium run disksspecificallydesignedforthis,it shouldn'tpresenta problem.However, 6) The screenclearsandyou are asked: usingthediskconstantlyfromsideto disk name? sideis not recommended.Copybothsides of thesedisksontotwonew disks. 7) Beforereplying,removetheoriginal diskfromthedrive.Inserta blank A finalreasonforcopyingthedisksis disk.The programerasesand formats thatof diskdriveheadalignment.Your thediskforuse as yourbackup. drivemaybe justslightlymisaligned. Thatwillnotcauseproblemsas longas 8) Typein a nameforthedisk(upto youuse diskswrittenby yourown drive. 16 characters). How do you makea backupcopyof our 9) Nextyou areasked: disk?If you areone of the luckyones uniquedisk id ? withan MSD DualDriveit is easy.Just placetheoriginaldiskintodrive0 (on Everydiskhas its own two characterID. theleft)and a blankdiskintodrive1 No disksshouldeverhavethesamedisk (ontheright).Thenissuethiscommand ID. It is hardto emphasizethisenough. fromCOMAL: TheCaptainCOMALGetsOrganizeddisk PASS"Dl-0" managementsystemwillhelp you keep More► page20,COMALUsersGroupUSA Ltd,6041MononaDr,Madison,WI53716,phone608-222-4432 ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■a* BackupYourDisks-continued trackof yourdiskID's(evenprinta numbersare 1-124again,but thisis chartof thoseyouhavealreadyused). a differentsetof 124blocks): Fornow,typein two charactersthatyou readingblock#— are SUREarenot yet usedin yourdisk library.Try [[ sinceit is unusual. 19)Afterthenext124blocksareread you'llsee themessage: 10)Instructionsappearon thescreen: insertdestinationdisk,pressSPACE insertsourcedisk,pressSPACE 20)You nowmaygobackto step14 and 11)Removethenew diskfromthedrive. continuethe cycleof swappingdisks Labelit withthedisknameand ID. backandforthas instructedby the Insertthe originaldisk,calledthe program.BE PATIENT!It may takeup sourcedisk.Thenhit the SPACEbar. to 12 diskswaps.Thelastpassof readingblocksfromtheoriginal 12)Ignoreinformationaboutthedisk sourcediskwillprobablystop thatscrollsby. It endsby beforeit getsto 124.Thatis your estimatingabouthow longthe copy signthatthisis thefinalswap. may take.Thenit counts andreads Putin thedestinationdiskas blocksfromthesourcedisk.The instructed.Afterit writesthe countis flashedon thebottom finalblocksit liststhedirectory screenline: of thenewlycreateddisk.H readingblock#— DDDDDDDDDDDDDDDDDDDDDaDDDDDDODDDD 13)After124blocksareread,more instructions appearon the screen: HOW COMAL RATES insertdestinationdisk,pressSPACE COMALSTARTERSHT 14)Takeouttheoriginalsourcedisk. Put thenew destinationdiskinto g A A the drive.Thenhit the SPACEbar. CaseofUse A A DocumentationA A 15)As blocksarewrittento thedisk, thecountis shown: writingbuffer# COMAL 0.14 Performance:10 Excellent:8-10 16)Afteralltheblocksarewrittenyou Easeofuse:9 Good:5-7 will see themessage: Reliability:9 Poor:under5 insertsourcedisk,pressSPACE Documentation:8 Fromthebook,TheBestVic/C64Software.Nootherlanguage gotaratingof10inanycategory,andnoneratedhigherin 17)Removethenewdestinationdisk.Put thesecategories. theoriginalsourcediskback into thedrive.Thenhit the SPACEbar. COMAL 2.0Cartridgerating:••••• COMAL 0.14StarterKitrating:**** 18)Now thefamiliarmessageappears FromINFOmagazine,COMAL 2.0wasthehighestrated programminglanguage(5starsisthehighest). again,flashingthroughthenextset of blocks,1 through124 (yes,the COMALStartersKitisnowcalledProgrammersParadise.Ofi COMAL UsersGroupUSA Ltd,6041MononaDr,Madison,WI 53716,phone608-222-4432,page21 CopyFiles Therearemanytimeswhenyoumaywish If it is a sequentialfile,SEQ in to copyjusta couplefilesfromone the diskcatalog,add a ,s afterits diskontoanother.To helpyouwiththis name.For example: task,we provideda program,SINGLEFILE comalerrors,s COPY,on TODAYDISK#1 and#2. It is a veryniceprogram,but couldnot copya 8) The programwill initializethe disk largeprogramfilelikeC64COMAL0.24. and will readin all the of the file So,we havenow providedanothersingle you specified.Thismessagewill filecopyprogram.It is notas friendly appear onthe screen: as thefirstone,but thisonewillcopy Readingfile... up to 40K files(upto about160blocks on a disk).Thus,it willcopytheC64 9) If it encountersa diskerrorit COMAL0.24file(131blocks).Thisnew will stopand print: program,calledCOPYFILES.BASIC,is on Diskproblem! theProgrammersParadiseDisk.Maximum memorywas neededfor copyinga large If the fileis toobig (over40K)it file,so theprogramwaswrittenin willstopandprint: BASIC.Do not loadit intoCOMAL.Here File too large! is how to use it: If all is OK it willpromptyou to 1)Turncomputersystemon. switchdisks: Insertdisk to writefile to 2) InsertProgrammersParadiseDisk and pressRETURN intodrive. 10)If allwas OK, takeout theoriginal 3) Enterthesecommands: diskand insertthe diskyou wish to load"copyflies.basic",8 writethe fileto. Thenhit the run RETURNkey. 4) Thescreenwillclearandthe 11)Whilethefileis copiedontothe programwillask: new diskthismessageis displayed Pleaseenterfilenamewith on your screen: ,s for SEQ or,p for PRG Writingfile... afterthe name: 12)Whenthefileis completelycopied, 5) Removethedisk fromthedrive. theprogramendswiththismessage: All done. 6) Insertthediskwiththefileyou wishto copyon it intothe drive. 13)If youwishto copyanotherfile, enterthe command:run andcontinue 7) Typein theexactnameof thefile at stepnumber4. you wishto copy.If it is a program file,PRG in the diskcatalog,add a See page 7 for instructionson how you ,p afteritsname.For example: can use thisprogramto make your own c64 comal0.14,p COMALstartupdisk.S page22,COMAL UsersGroupUSA Ltd,6041MononaDr,Madison,WI53716,phone608-222-4432 DoubleSidedDisks "Willa doublesideddiskette,suchas a Thatiswhatyoushoulddowithall COMALTODAYDisk,workin theCommodore disksyourecievefromus (andother 1541diskdrive?"We'vereceivedcards softwaredistributors).Thediskyou andlettersfromseveralnew COMALites receiveis consideredyourMASTERDISK. aroundthecountrywhoweren'ttoosure. Never usea masterdisk.Useonlycopies of it.Thenif anythinghappensto the We now distributediskswithprograms disk,youneedonlymakeanothercopy. storedon BOTHsides.Whilethismethod Thisis especiallytruewithCommodore is greetedwithjoy by most,somewonder formatdisks,sincethe1541,4040and how thesinglesided1541diskdrivecan MSDdrivesarereadcompatible- butNOT reada doublesideddiskette. writecompatible.Ourmasterdisksare usuallycreatedon a 4040driveandare The 1541can reada doublesideddisk not copy protected. onlywitha bit of help.Youmust providethehelpby flippingthe Masterdisksshouldnever,neverbe disketteover.Here'show it works. writtenon.To insurethatyoudon't accidentlywriteon oneof yourMasters, Forexample,TODAYDISK#9 has COMAL manyof thediskswe distributehaveno 0.14programsstoredon thefrontside. writeprotectnotch.Thatmakesthem To use theprograms,simplyinsertthe READONLYdisks.M diskettetheusualway,withthelabel DDDDDDDDDDDanDDnnnDDDDDDDDnDDDDDD up, and followthe loadinginstructions. ThetrickypartcomeswhenCOMAL2.0 THAT'SWHAT THEY SAID... cartridgeownerswant to use the 2.0 Iflanguagesinterestyou,thisoneiswellwortha look... programsthatare storedon theback It'sinexpensivetotry.Youmayfindthatit'sjustwhat sideof thediskette.The1541drivehas youhavebeenlookingfor. -JimButterfield,Compute! onlyoneread/writehead,not two.You musttakethe disketteout of the drive COMAL wasjustwhatIwaslookingfor. and flipit over.Theninsertit in the -ColinThompson,RUN drivewiththelabeldown. OverallCOMAL averagesouttoabout3 timesfasterthan BASIC. Afteryou'vedonethis,the1541'sread/ -LorenWright,Micro writeheadcan readthebacksideof the Thisdiskisfantastic! diskette.The 2.0programscanthen be -Tom Lynch,TheUsersPort loadednormally. Idon'thaveenoughspacetolistallthegoodpoints! -Noland Brown,MidniteSoftwareGazette By recordingprogramson both sidesof thediskyougettwodisksof programs Icanrecommendabetter,faster,andcheaperprogramming language.It'saflashylittleEuropeanimportcalled on one disk.We use onlyspecialdisks COMAL...themostuser-friendlylanguagearound. manufacturedspecificallyto be usedon -MarkBrown,Info bothsidesby flippingthediskover. CombinessomeofthebestfeaturesoflanguageslikeLogo, Modula,Pascal,andAdainaneasy-to-useformat. We expectyou to copythe programson -Ahoy bothsidesto twootherdisks,and then Everybodywhogetsit,likesit! fileawaythe originaldiskas a Master. -LenLindsay 0 COMAL UsersGroupUSA Ltd,6041MononaDr,Madison,WI 53716,phone608-222-4432,page23 * Subscribersarewelcometo sendus a Exceptionforschoolsonly:we will letterwithquestionsaboutCOMAL. If accepta PurchaseOrderonlyif we are youwisha replyyoumustincludea self guaranteedpaymentwithin30 daysof our addressedstampedenvelope. shippingdateand thatwe do nothaveto filloutany specialforms.We supply * We nowhavea wideselectionof books severalcopiesof our invoiceto the and disks.COMALTODAY#7 presents schoolunderseparatecoveras our reviewsof thebooks.Disksare requestforpayment. discussedin eachissueof COMALTODAY. * Foreignordersare accepted,but not * Subscribersgeta discount!Notonly solicited.Theyrequirespecialhandling is a subscriptionto COMALTODAYgoing whichmeansan extradelay.Alsothe to helpyouwithinformation,tipsand shippingcostsareveryhigh. programlistings;as a subscriberyou geta discounton nearlyeveryitemwe * We cannotshipCOMAL2.0 Cartridges offer(theorderformhas twoprices; outsideofNorthAmericaancfwe cannot subscribersgetthelowerprice). shipCOMAL0.14to Denmarkor Sweden. * Rememberto addon theshippingcost HOW TO PLACEAN ORDER as notedon theorderform.Shippingto Canada andAPO addressesis more Use theorderformprovidedto orderby expensive,sincewe can'tuse UPS. mail.Or,MondaythruFriday,8:30am Overseasshippingis veryexpensive! until4 pm youmay call(608)222-4432 to orderby phone(VISAor MasterCard * Allordersmustbe prepaid(noCOD). ONLY).IMPORTANT:we needa street VISAandMasterCardare acceptedand addressfordelivery(noPO boxes). providethe fastestprocessing.Money Ordersalsoallowquickservice(a * Allowus 2 weeksto processand ship CanadianPostalMoneyOrderin US yourorder(timewilloftenbe less- Dollarsis fine).Checks(inUS Dollars but sometimesmore).Add to thata drawnon a US bank)areaccepted,but reasonableamountof timefor it to be shipmentmaybe delayedfor2 weeks delivered(aswellas timeforyour whilethecheckclearsthebanks. ordertogettousifyoumailit).IS ****************************shipmentsmay include2 disksofprogramsasonedoublesideddisk**♦*♦♦♦*♦***♦♦**♦♦**♦♦**♦♦*♦ BULKRATE COMALUSERSGROUP,U.S.A.,LIMITED U.S.POSTAGE PublishersofComalToday PAID 6041MononaDrive MADISON.WI PERMIT2981 MADISON,Wl53716 Entirecontentscopyright1986COMAL UsersGroup,U.S.A.,Limited.Althoughaccuracyisamajorobjective,COMAL UsersGroup, U.S.A.,Limitedcannotassumeliabilityforprogramorinformationerrors.Pleasenotethesetrademarks:Commodore64,CBM of CommodoreElectronicsLtd;PET,EasyScriptofCommodoreBusinessMachines,Inc;CalvintheCOMAL Turtle,CaptainCOMAL, COMAL TodayofCOMAL UsersGroup,U.S.A.,Limited;Buscard,PaperClipofBatteriesIncluded;CP/MofDigitalResearch;Z-80 ofZilog;IBMofInternationalBusinessMachines;AppleofAppleComputerInc.Sorryifwemissedanyothers.