JOYTemplate for Footer group  hXOkIz k phlI Y%z kZ-KiZ-K N"զI` {x R< N"զI` {x R#<L$ЦIz yx UL$ЦIz xx UL$ЦIz x UL$ЦIz ~x UL$ЦIz }x UL$ЦIz |x UL$ЦIz sx UL$ЦIz rx UModern ++Y"ټKۺ[X۹:ѩںRj}[Yq˫˻"wDd9r99̷ܻۛYgͻںۻɫۻʘ٩۫٘ xScript 1: 0x R<  Spreadsheetx xScript 1: 0x R<  &KPage=== :(c)copyright1989byGeoffBuckeridge xScript 1: 0x R< @ Spreadsheet(cont)x xScript 1: 0x R<  &KPage=== :(c)copyright1989byGeoffBuckeridge xScript 1: 0x R# Introduction  H1ThisspreadsheetiswritteninMallardBasic.Despitethisadmissionitdoes  runsurprisinglyfastandisamazinglypowerful.Thereareoneortwo  [0limitations.Firstlythespreadsheetwillnotexceedthesizeofthescreen. (Thatis25cellsdownand10cellsacross.Thehorizontalnumberofcellscanbeadjusted.  .Theslightsluggishness,mustbeexpectedduetothelanguageitiswrittenin.  |eThislimitation,ishowever,greatlyoffsetbythemanyadvantagestobe  R;gainedfromit.Itsformulacalculatingpower,forinstance,isonlypossiblebecauseitiswrittenininterpretedbasic.  Fewsmallbasicspreadsheetswouldbecapableofhandlingascomplexaformulaasthis:-(c8*months)+((c23/4*weeks)-(17*a12)) 'Youcanseethattheformulaisverysimilartothosewhichmightbefoundin  P9anybasicprogram.Andthat'sthebeautyofit.Thisspreadsheetactually  R;writesandrunssmallbasicprograms.SothecomplexityoftheformulaeisIgovernedonlybythelimitationsofbasicitself.  xScript 1: 0x R# `Features  Q&Tosimplifyoperationgreatly,cellreferencesareusedlikec8,c23anda12. nTheserelatedirectlytothecellsonthe25x10gridwhicharelettered!horizontallyandnumberedvertically.  G0Usefulfeaturesinclude'cutandpaste'toreplicatecellcontents.Uptotenmemoriesareprovidedforthispurpose.  U>Wildcardscanbeusedinnon-cell-dependantsituations.e.g.!1+!2+!3canbe :#placedincelld4toproducethesumofd1,d2andd3,orthesameformulain pYcellg7willgivethesumofg1,g2andg3.Thisexampleshowsawayof  <%performingcalculationsoncolumns.Thesameapproachcanbeappliedtoline  1calculations.Butthistimethequestionmarkreplacesthecurrentlinenumber.e.g.a?+b?+c?.  'Oneotherfeatureistheabilitytoacceptstraightforwardbasiccommandsin # anyofthecells.ThisisgoodforincludingIF/THEN/ELSEstatements.You  S<couldevenusesomeofthemoreexoticcommandslikeRND,UPPER$,orPRINTxUSINGwhichallowsyoutotailorthespreadsheettodojobsotherscan't.  xScript 1: 0x R# `Tutorial Nowletsruntheprogram.ItworksbestifitisrunfromtheMdrive,though  5thatisnotabsolutelynecessary.LoadCP/MandcopyBASIC.COM,SPREAD.BASandany.SSSfilestoM:.LogontoM:andtype:-BASIC SPREAD. Thedisplaywillstartoffwithanemptyspreadsheet.Noticefirstofallthat |eitiseightcolumnswide,labelleda-h.Tryusingthecursorkeystomove  aroundthescreen.Nowletsloadanexistingspreadsheetbytyping'EXTRA'and'R'together,andwhenprompted,thefile-nameACCOUNT. Afterawhiletheframewillfillfromthetop,startingwithtext,thenaftera D-briefpause,thenumbers.Movethecursortothemonthlyfoodcell,theone P9with100.00init.Press'ENTER'or'RETURN'andtype'140'thebottomline shouldsay'InNumeric#=140'.Hitandafterashortwhileallthenumericgvalueswillberecalculated.Trythisagainusingavalueof400thistime. 7 Next,ensurethereispaperintheprinterandtype'EXTRAP'whichwilldoa nvirtualscreendump.Installanewsheetofpaperandusethe'EXTRAC'commandtodumpallthecellcontentstotheprinter.  Youwillfindthatifyoumovethecursorandpress'EXIT'thecontentsofthat *cellisdisplayedatthebottomofthescreen.Itispossibletoeditthisline  quitesimply,usingnormallineeditcommandswhichwillbefullydescribedlater. U>FornowsticktocursorandDELkeys.Alsousethe[+]totheleftofthe  spacebar,whichswitchesbetweenINSERTandOVERSTRIKEmode.Noticehowthe ` xScript 1: 0x R#  9firsttwocharactersofthelinechangetoinformyouwhichmodeisengaged.  Alsoinsteadofcursoringfromcelltocell,tryusing'FIND'followedbyaletteroranumberorbothtomovedirectlytoaspecificcell. /Studyboththeprintoutofthecellcontentsandthescreenandtryandwork S<outwhatishappening.Thepatternissimple.Ifthelinebeginswitha'#' I2symbol,itiseitheranumericconstant(e.g.cellc10)oraformula(e.g.cell 3g10).Ifitbeginswitha''thenabasiclinefollows.Ontheotherhandif  neithersymbolispresentitispurelyatextcellwhichisignoredwhen;recalculationoccurs.  Togojustonestepfurther,ifthesecondcharacteronthelineisa'='itis  shorthandfor'thiscellequals'.Forexampleincellf23youcouldput  +'#g23=100'butthiswouldhavethesameeffectasputting'#=100'incellg23. :#Thedifferenceisthatthevalueishidden.Todisplayitgotocellh23,andmakeit#=g23. Lookatcellsa2andb2whichareabitdifferent.Theyintroducetwo  variables,fredandmary,andassignvaluestothem,equivalenttothesepeoples2monthlysalary.Bothvariablesareagainreferencedincellg8.  vCellsd10,d12,d20,andd21areexamplesusingthewildcard'?'whichis  automaticallyreplacedwiththecurrentlinenumber.Seehowthesamecommand"readsdifferently,dependingonwhichcellitisin. p xScript 1: 0x R#  `ISofarwehaveonlydealtwithnumericcellswhichareinitialisedeitherby aJpressing'ENTER'or'#'.Theothermaintypeisthetextcell.Thisoneis B+easytofillasitisinitialisedbytypinganynon-commandcharacter.Goto Af24andtype'Thequickbrownfox'slowlysothatyoucanwatchthescreen.AYouwillseethateacheachcellisfilledandthenincremented. K4BeforewefinishwithACCOUNTstudycellsa1andb1.Thesearebothbasic L5typecells.Iwontdiscussthese,indetailbutleaveitforyoutoworkout # whattheyaredoing.Aclueisthatarrayb()referstothenumericcells,and arrayb$()referstothetext.Cellg12isreferencedbyb(12,7)Ifyouwant mVtoenterbasicatacell,press''andtypeyourline.Ifthespreadsheet J3doesn'tlikeitanerrorwilloccur.TheerrornumberisstraightoutoftheMallardBasicerrorcodelist. A*Ifyouwanttosavethisspreadsheetjusttype'EXTRAS'butIwouldadvise 9"younottocallitACCOUNTasitwilloverwritethepreviousversion.Asyou zcseeitreturnstothesameplacesoyoucouldcontinue.However,onthis occasionwewillclearthescreenreadyforanothergo.Press'TAB'andanswer thepromptwiththevalueeight.Thiswillgiveyouthesameemptydisplayyou 5startedwith.TryTABagainbutthistimeselect5columns.Thenumberyou 3chooseatthisstagecannotbechangedonceyoustartfillingthecells,asit L5willclearthemagain,sochooseitcarefully.Thisnumberisalsosavedandloadedwithyourspreadsheet,ofcourse.  M6Oneortwoothercommandsdeserveaspecialmention.Forinstancethecell  memory.Tostorethecontentsofacellpress'EXIT'togointoeditmodethen ` xScript 1: 0x R# B'COPY'thenanynumber0-9.Thiswillcopythiscelltooneoftenmemories. M6Torecallitpress'PASTE'thenthesamenumber,whileyourcursurisintheframe.Thememorycanbeusedonanytypeofcell. P9Anothercommandofnoteis[-],totheleftofthespacebar,whichtoggles T=autocellincrementon/off.Withitoffthecursorreturnstothesamecell (afterentry.Toggledon,thecursormovestothenextcellontheright,readyIforthenextentry.  Ithinkthataboutcoversmostofthecommands.Therestwillbedealtwithin  tIthecommandsummary.Allthelineeditingcommandsarealsolistedthere. 2BeforemovingonloadupandstudyEXPENSESinthesamewayaswedidwithACCOUNT.  %Ihopeyouarebeginningtounderstandtheintricaciesoftheprogramandcan v_anticipatesomeusesofyourown.Itreallyisquitefuntousewhenyoubecomefamiliarwithit.  xScript 1: 0x R# XCellCommandSummary.RCAN #Erasescurrentcell.CURSORKEYS #Tomovefromcelltocell[-] #Automovetonextcell,toggleon/off.# #Numericleader. #Basicleader.=ENTER #ThesameasRETURN.EXIT #Editcurrentcell.EXTRAC #Doesaprinterlistingofthecellcontents.EXTRAP #Printsavirtualscreendump.EXTRAR #Recallfile.Againyouareaskedfora. #filename.Beepsifitdoesn'texist.EXTRAS #Savefile.Youarepromptedforafilename.xFIND #Godirectlytoaparticularcell.PASTE #Pastesoneoftenmemoriesatcurrentcell #position.RELAY #Runsbasiconlycommands.FRETURN #Enternumericconstantorformula.gSTOP #ExitsSpreadsheetbacktobasic.3TAB #Setsthehorizontalnumberofcells.H xScript 1: 0x R# hLineEditorCommandSummarywCAN #Exitslineeditignoringchanges.COPY #Copiesthiscelltooneoftenmemories.{CURSORLEFT/RIGHT #Movesthecursorleftorrightonecharacter.CUT #Deletestotheendoftheline.)<-DEL #Deletescharactertoleftofcursor.4DEL-> #Deletescharacterunderthecursor.=ENTER #ThesameasRETURN.FIND #Togglescursorbetweenendoflineandthe9 #beginningoftheline.RETURN #Terminateslineeditmode.[+] #Togglesbetweeninsertandoverstrikemode.