Artº I'vå useä WordStaò conventioî oæ surroundinç wordó tï be boldeä witè CTL-B® Hopå yoõ caî dï this. Aô thå enä oæ thå articlå ió á listinç oæ aî excerpô oæ the BACKUP.ZEØ scripô É describå herein® Iô shoulä bå printeä as á "Figurå n¢ nexô tï thå article. Thió baby'ó á biô long» hopå yoõ caî fiô it¡ Thanks. Besô tï yoõ anä yours. ­ Rick Columî foò TCÊ #38¬ May/Junå 1989 ZEØ ANÄ HARÄ DISË BACKUPS bù Ricë Charnes I'ä likå tï starô ofæ thió issuå witè aî appeaì tï alì useró of ZCPR³ withouô á modeí tï givå seriouó consideratioî tï getting involveä iî thå BBÓ world® Thå nationwidå networë oæ Z-Nodeó we havå establisheä ió perhapó thå besô waù wå havå tï educate ourselveó iî thå manù aspectó oæ ouò extraordinarù operating system® Iî thå lonç intervaló betweeî TCÊ issueó thió network remainó ouò foremosô meanó oæ communicatinç witè eacè other® Its senså oæ immediatå actioî anä responså witè manù individuals helpinç eacè otheò anä sharinç programó thaô wå havå writteî is perhapó thå singlå mosô importanô sourcå oæ thå energù behinä the Ú world® Alì thå ZCPR³ columnistó yoõ reaä herå iî TCÊ -­ Jay Sage¬ Bridgeò Mitchell¬ Brucå Morgen¬ Caí Cotrill¬ Haì Boweò and myselæ -­ arå alì activå participantó iî thió network® É cannot emphasizå ho÷ mucè thió kinä oæ sharinç anä give-and-takå caî add tï youò enjoymenô oæ computing® Anä iô caî alì bå donå easily witè á minimuí oæ phonå chargeó viá PC-Pursuit. Thå PÃ Pursuiô network allowó thoså witè á modeí livinç iî the metropolitaî areaó oæ thå U.S® tï accesó anù bulletiî board systeí nationwidå (again, iî thå metropolitaî areaó oæ the country© durinç weekendó anä non-businesó houró foò á flat monthlù feå oæ $30® Thió makeó iô easù anä inexpensivå tï call, amonç manù others¬ twï oæ thå mosô populaò Z-Nodes¬ thå official TCÊ BBÓ aô (312© 649-173° and Jaù Sage'ó Newtoî Centrå Z-Nodå at (617© 965-7259® Foò morå informatioî abouô PC-Pursuiô call Teleneô aô (800© 336-0437. Therå haó beeî mucè discussioî oî thå Z-Nodeó iî recenô months oî thå subjecô oæ ZEX¬ thå ZCPR³ world'ó preeminenô 'batch processor'® Iô ió partlù occasioneä bù Joå Wright'ó releaså in autumî oæ 198¸ oæ ZEØ versioî 4.03¬ partlù froí continued enthusiasí oveò Jaù Sage'ó releaså oæ NZEX-Ä quitå somå timå ago anä hió incorporatioî oæ ZEØ intï ZFILER'ó magnificenô group macrï facility¬ anä partlù duå tï thå facô thaô iô ió simplù in generaì aî extraordinarù prograí allowinç foò tremendous opportunities foò automatioî wherå nothinç (noô eveî Kinç ARUNZ!) elså wilì do® Iæ É aí noô mistaken¬ Bridgeò Mitchell'ó column Šthió issue ió devoteä tï á reconceptualizatioî oæ whaô ZEØ should be¬ anä aó á fervenô admireò oæ thå prograí (É uså iô whereveò I can!) É aí verù mucè lookinç forwarä tï furtheò developmentó of thió prograí bù Bridgeò anä hió colleagues. Iî thaô spirit¬ then, anä aó mentioneä lasô time¬ É woulä likå to attempô tï givå readeró á flavoò oæ whaô ZEØ caî dï iî the contexô oæ discussinç onå particulaò uså tï whicè É puô it¬ the BACKUP.ZEØ scripô É uså foò backinç uð mù harä disë directories. Iæ otheró havå feareä ZEØ becauså oæ itó reputatioî for eccentricitù anä exotiã nature¬ iô ió perhapó foò thió very reasoî thaô É havå embraceä it® ZEØ mighô bå compareä tï the CP/Í SUBMIÔ thå waù onå mighô comparå thå experiencå oæ listening tï á Toð 4° radiï statioî tï attendinç á livå performancå oæ the 181² Overturå giveî bù thå Saî Franciscï Symphony® Hopefully betweeî mù anä Bridger'ó columî yoõ wilì bå inspireä tï archive gooä olä SUBMIÔ ontï á sturdù buô yellowinç floppù anä movå oî up tï thå ethereaì realms oæ ZEX. Thió columî ió intendeä generallù foò thoså witè somå prior experiencå witè ZEX® É aí noô herå goinç tï explorå alì its nooks¬ crannieó anä meadows¬ filleä aó theù arå witè fragranô and variegateä bloom¬ thougè thaô woulä certainlù bå á wonderfuì and worthwhilå venture® Iô wilì noô bå á primeò oî thå basicó oæ its use® É wilì oæ necessitù toucè oî somå oæ itó features¬ buô my purposå herå ió mostlù tï explorå á fe÷ particulaò exampleó of ho÷ iî mù BACKUP.ZEØ scripô É havå interfaceä ZEØ witè botè the ZCPR³ shelì variablå subsysteí anä thå ZCPR³ registers¬ the combinatioî oæ alì threå oæ whicè ió guaranteeä to bå a pick-me-uð tï thå mosô tireä oæ "there's-nothing-left-to- explore-in-CP/M¢ ne'er-do-well's® Iî studyinç somå oæ these fairlù specifiã ZCPR³ anä ZEØ programmatiã techniqueó É aí taking á gamblå anä hopinç thaô thå readeò caî dra÷ somå generaì lessons. Likå á goodlù numbeò oæ harä disë owneró É havå spenô many (generallù happy© houró tryinç tï finä thå absolutelù perfect prograí tï perforí mù regulaò periodiã backuð oæ thoså hundreds oæ preciouó fileó É havå lovinglù createä oveò thå years® Sadly É havå founä nï sucè program® É havå yeô tï finä anù schemå that addresseó whaô É believå tï bå thå centraì dilemmá oæ á harä disk backuð programº ho÷ tï ensurå durinç one'ó periodiã backupó on harä disë directorieó requirinç morå thaî onå backuð floppy¬ that witè eacè periodiã backuð anù giveî filå ió copieä ontï thå same backuð floppy. Wheî backuð programó thaô havå nï provisioî foò thió arå ruî for thå firsô time¬ theù simplù filì up¬ iî completelù randoí order, á giveî numbeò oæ floppieó witè thå fileó froí thå harä disk. Eacè successivå ruî copieó thå fileó iî thå samå oò another randoí order. Suppose¬ however¬ witè thió firsô ruî oæ thå backuð prograí my ALIAS.CMÄ happenó tï geô copieä ontï thå thirä floppù iî á seô of fivå froí mù rooô directory® Then¬ nexô weekenä wheî É ruî the backuð prograí again¬ assuminç I'vå modifieä ALIAS.CMÄ anä the Šarchive biô ió thereforå turneä off¬ iô wilì agaiî bå copieä by thå program® Buô there'ó nothinç tï guaranteå iô wilì thió time bå copieä tï thå samå floppy¡ Iô maù enä uð oî thå first¬ or second¬ oò fifth¬ disk® Afteò severaì runó oæ thå backuð program É maù enä uð witè severaì differenô copieó oæ ALIAS.CMÄ on differenô backuð floppies¬ modifieä aô differenô timeó oî the harä disk¡ É havå yeô tï seå á satisfactorù solutioî tï this probleí iî termó oæ á singlå program. Iî thå truå spiriô oæ "Z,¢ therefore¬ oò whaô Franë Gaude§ used tï calì "thå tooì approach,¢ É havå writteî á ZEØ filå tï dï the job® É havå decideä thå besô solutioî lieó iî copyinç thå files ontï thå floppieó iî alphabeticaì order® É havå settleä oî six foò thå numbeò oæ backuð floppieó requireä bù eacè oæ mù major harä disë directories® É backuð ontï floppù onå alì files beginninç witè thå letteró Á througè D¬ floppù twï getó thå files beginninç witè Å througè J¬ anä sï oî througè thå alphabet, reservinç floppù siø foò thå "Z¢ fileó oæ whicè foò some mysteriouó reasoî therå alwayó seeí tï bå aî inordinatå numbeò on virtuallù alì mù directories... É dï thió witè 2¶ separatå invocationó oæ PPIÐ (renameä tï COPY), onå foò eacè letteò oæ thå alphabet¬ useä witè itó '/ae§ option tï indicatå "copù onlù fileó whicè havå beeî modifieä fileó since lasô backup¬ anä writå oveò thå destinatioî filå without querying,¢ aó follows: ^ copù a*.ª bakº /ae copù b*.ª bakº /ae copù c*.ª bakº /ae copù d*.* bakº /ae ^ ^? ^ copù e*.ª bakº /ae copù f*.ª bakº /ae . . etc. Anù texô betweeî ^¼ anä ^¾ ió echoeä directlù tï thå screen® The ^¿ commanä stopó anä waitó foò thå useò tï hiô anù keù aô which poinô thå scripô continues. Yoõ needn'ô worrù abouô ZEØ fileó beinç toï large® Oncå they're loadeä nï furtheò slowdowî iî youò systeí ió noticed® Iî any case¬ whilå they'rå beinç loadeä yoõ don'ô havå timå tï get impatienô aó you'rå toï busù watchinç thå beautifuì videï screen displaù you'vå created! Thió alphabeticaì orderinç schemå ensureó thaô every filå is alwayó backeä uð oî toð oæ itó previouslù backed-uð copy/version. Thió week'ó ALIAS.CMÄ ió alwayó copieä oveò lasô week's ALIAS.CMD¬ anä today'ó TCJ-COL.² wilì alwayó anä automaticallù be copieä ontï thå samå disë aó yesterday'ó copy. ŠÉ havå oveò thå yearó addeä tï mù BACKUP.ZEØ thå mosô beautiful graphicó anä boø drawingó oæ whicè mù Qumå 10² ió capable¬ and combineä witè extensivå uså oæ itó videï attributeó sucè as reverså video¬ blink¬ underline¬ anä cursoò ofæ É havå created whaô É feeì tï bå thå equal¬ iî termó noô onlù oæ functionality anä poweò buô oæ beautifuì screeî display¬ oæ anù MS-DOÓ backup program® Oæ courså there'ó onå additionaì factoò thaô iî mù eyes makeó iô eveî betterº É wrotå iô myself! É shoulä mentioî aó an asidå thaô á verù largå numbeò oæ popular anä commoî CP/Í terminaló arå capablå oæ á greaô deaì more graphics¬ boxes¬ windows anä otheò fancù videï displayó thaî we normallù uså oò eveî suspect® Theså featureó ofteî remain unknowî anä unutilizeä simplù becauså theù werå never standardizeä amonç thå greaô varietù oæ CP/M-stylå terminals. Therå ió nothing¬ howeveò -­ É repeatº nothing -­ tï keeð an individuaì useò froí creatinç foò himselæ quitå anä surprisingly beautiful¬ iæ noô transportable¬ screeî displays® ZEØ scripts, witè theiò "^¢ command¬ alonç witè ZCPR3'ó ECHO command¬ givå thå useò á greaô opportunitù tï dï this¬ anä many oæ mù ZEØ fileó anä ARUNÚ aliaseó arå reaì beauties® Iô is especiallù unfortunatå thaô theså fancù featureó gï unuseä iî our CP/M-compatiblå world» thå lacë oæ "graphics¢ ió alwayó being touteä aó onå oæ thå reasonó foò people'ó decisioî tï leavå their olä CP/Í boø behind. Yearó agï Dennió Wrighô wrotå á seô oæ assemblù language routines¬ GRWLIÂ anä GRXLIB¬ thaô producå extremelù sophisticated anä beautifuì graphicó windowó anä menus¬ thå windowó capablå of overlayinç eacè other¬ appearinç anä disappearing¬ witè text inside¬ etc® Similarlù wå alreadù havå onå seô oæ graphics windowinç librarieó foò Turbï Modula-2¬ anä Mr® Edwarä Jacksoî of Californiá wilì sooî bå releasinç another® É havå useä these Modula-² routineó tï writå COÍ fileó oî mù littlå ol§ Morro÷ that rivaì displayó I'vå seeî oî earlù MacIntosheó anä videï arcades. É woulä urgå useró tï takå witè á graiî oæ salô claimó foò any allegeä "lacë oæ graphics¢ iî CP/Í anä tï incorporatå these librarù routineó intï theiò programming® Thå beautifuì displays reallù makå á differencå anä greatlù adä tï á finisheä product. Iî anù case¬ thå alphabeticaì orderinç schemå É uså iî my BACKUP.ZEX¬ alonç witè thå beautifuì graphicó É havå coaxeä out oæ mù terminaì witè it¬ haó noô onlù proveî eminentlù satisfying buô haó haä thå unintendeä (buô verù welcomed© sidå effectó of giving må aî opportunitù tï spenä manù happù houró acquainting myselæ witè mù terminal'ó videï commandó aô thå samå timå aó it sharpenó uð mù ZEØ skills... Iî anù case¬ untiì abouô siø monthó agï É haä felô mù BACKUP.ZEX tï bå completå aó describeä above® Thå alphabeticaì ordering schemå workeä perfectly¬ anä thå artistiã videï displayó and friendlù messageó É addeä tï iô madå backinç uð á pleasure, certainlù aî importanô consideratioî iî á tasë normally considereä tï bå thå quintessentiaì drudgå work. Afteò adding thå ability¬ aó describeä iî lasô issue'ó column¬ tï displaù to Šthå screeî thå datå anä timå oæ thå lasô backup (abouô whicè I felô anä stilì feeì verù proud!© É coulä thinë oæ neitheò bell noò whistlå tï adä tï it. Thå onlù thinç thaô occasionallù bothereä må ió wheî mù backup disë woulä filì up® Thió situatioî ió mosô annoying® PPIÐ would oæ courså reporô thå error¬ buô considerinç I'í insidå á ZEØ file there'ó noô mucè iô caî dï abouô it® Iæ thå disë woulä filì up, foò instance¬ durinç thå backinç uð oæ thå "B¢ files¬ É would theî havå tï suffeò througè PPIP'ó attemptó tï copù alì the unarchiveä "C" anä "D¢ files¬ witè eacè oæ theså attempts virtuallù guaranteeä tï fail® Althougè PPIÐ ió smarô enougè so thaô iæ iô senseó thå destinatioî disë ió fulì durinç onå oæ the copieó iî á PPIÐ B*.ª BACKUPº commanä iô wilì aborô that particulaò wildcarä operation¬ there'ó nï waù iô caî anticipate thå NEXÔ commands¬ beinç herå oæ courså 'PPIÐ C*.ª BACKUP:§ and 'PPIÐ D*.ª BACKUP:.' Iô woulä theî oæ courså blithelù attempô to executå theså eveî thougè thå tasë waó impossible. Ho÷ waó iô tï kno÷ this¿ I haä tï patientlù watcè sometimeó 5¬ 6 anä · PPIÐ "disë full¢ messageó durinç copieó anä noô beinç able tï dï anythinç abouô it® Iæ É woulä CTL-Ã durinç thå particular PPIÐ operatioî thaô senseä thå disë full¬ iô woulä reporô á "User abort,¢ terminate thaô particulaò PPIÐ commanä -­ anä simplù move oî tï thå next. Well¬ whaô dï yoõ expect¿ It'ó jusô á computer! É haä onlù onå waù ouô oæ iô aô thå time® Eacè timå mù backup disë woulä filì up¬ É woulä despairinglù watcè iô happen¬ poor PPIÐ torturinç itselæ witè trying¬ anä wheî thå scripô pauseä for må tï changå diskó I'ä CTL-Ã ouô oæ iô anä aborô thå entirå ZEX script® I'ä theî manuallù eraså oî thå backuð floppù whatever fileó É determineä unnecessarù anä obsolete¬ anä restarô the scripô froí thå beginning. Thougè iô beinç thå latå 80'ó anä É knowinç thió isn'ô what computeró arå supposeä tï do¬ É couldn'ô reallù thinë oæ anù way ouô oæ thå situation® É meaî afteò alì thió ió oî aî obsolete Morro÷ computeò runninç aî esoteriã anä little-useä enhancement oæ aî antiquateä operatinç system® What¬ afteò all¬ coulä I expect? Operatinç undeò thå principle, however¬ iî mù lifå generallù as welì aó iî mù computeò programminç specificallù thaô iô ain't whaô yoõ goô buô whaô yoõ dï witè it¬ thå Greaô Spiriô of Computeró seemó tï havå paiä må onå oæ itó irregulaò visits® It onå daù hiô meº iæ PPIÐ ió smarô enougè tï kno÷ wheî a destinatioî disë full¬ can'ô É geô thå operatinç systeí tï know? Thió ió ZCPR3¬ afteò all. É keeð hammerinç homå tï alì whï wilì listeî thaô onå oæ the uniquå aspectó oæ ZCPR³ ió thå waù iô provideó methodó foò all itó separate componentó tï leavå messageó foò eacè other® This ió thå raisoî d'etrå oæ thå ZCPR³ messagå buffeò generallù and Šthå erroò flaç particularly¬ thå latteò oæ whicè ió herå the perfecô messengeò foò ouò job. É decideä tï modifù PPIP¬ otherwiså á ZCPR3 tooì iî onlù thå most superficiaì manner¬ tï seô thå ZCPR³ erroò flaç undeò certain conditions® É addeä codå sï thaô iô no÷ setó saiä flaç tï 7 (thió figurå arbitrarilù chosen© iæ iô senseó á destinatioî disk full® Thió waù wå providå á hook¬ througè thå "IÆ EÒ 7¢ command, foò ZCPR3¬ anä noô jusô PPIP¬ tï senså thå disë fulì conditioî -- anä theî providå á waù out. Whilå É waó fiddlinç arounä witè PPIP'ó internaló É decideä to alsï seô thå erroò flaç iæ thå useò enteró á CTL-Ã durinç á copy operation® Occasionallù É woulä seå á backuð copù takå place thaô foò á numbeò oæ differenô reasonó É didn'ô wanô tï happen, anä É haä alwayó wanteä somå waù tï allo÷ ZEX¬ anä noô PPIÐ alone tï aborô iæ thió happened® No÷ É haä it. Finally¬ PPIÐ will no÷ seô thå erroò flaç tï '9§ iæ the destinatioî directorù haó nï remaininç entries® PPIP1¹ with theså abovå modificationó ió availablå oî alì Z-Nodes. Alì thaô waó necessarù iî thå ZEØ scripô waó tï adä thå commands IÆ ERROR;GOTÏ ERR;FI» afteò eacè invocatioî oæ PPIÐ aó follows: copù a*.ª bakº /ae iæ er gotï err fi copù b*.ª bakº /ae iæ er gotï err fi . . . Afteò É haä modifieä PPIÐ tï seô thå ZCPR³ erroò flaç É then createä á routinå aô thå bottoí oæ thå scripô anä begaî iô with thå labeì ';ERR§ (ZEØ labeló begiî witè á semicolon)® Aô this labeì therå arå onå oæ twï erroò messages¬ sayinç eitheò thaô the backuð disë waó fulì (erroò flaç seô tï 7© oò thaô á useò abort waó entereä (erroò flag=8)® (É didn'ô botheò addinç á "directory full¢ erroò messagå aó thaô neveò happenó oî mù floppies¬ though thaô coulä easilù bå done.© Thå useò ió thuó giveî thió message botè bù thå prograí (PPIP© anä thå operatinç systeí (ZEØ acting herå aó á proto-operatinç system.© Thå scripô woulä then properlù aborô aó É wanted® Nï morå helplesslù watching unnecessarù anä impossiblå copies. Á listinç oæ thå erroò routinå oæ BACKUP.ZEØ ió printeä aó Figure ___. Aó iô ió fairlù lonç É aí noô goinç tï describå herå thå entire script® É wanô onlù tï focuó oî thå partó oæ iô thaô relatå to thå sparkó thaô wenô ofæ iî mù minä consequenô tï thå above modification. ŠThå codå É addeä abovå ('iæ err;gotï err...© simplù printó an erroò messagå anä letó ZEØ aborô tï thå commanä processor. Havinç ZEØ aborô waó thå onlù waù É coulä conceivå oæ dealing witè thå situation® Wheî thå backuð disë filleä uð É needeä to dï somå worë oî mù own¬ outsidå oæ ZEX¬ tï eraså unneedeä files oî thå backuð floppù aó welì aó otheò things® É woulä neveò be ablå tï anticipatå whicè taskó É woulä neeä tï perform® Aborting ZEØ anä returninç tï ZCPR³ provideä aî opportunitù tï dï whatever É needeä to® Wheî É waó readù tï resumå É woulä simplù reruî the ZEØ script. Buô thå Muså oæ Computeò Automatioî wouldn'ô leô gï oæ me® Soon É starteä thinkingº herå É aí usinç thió incrediblù powerful tool¬ suiteä tï thå automatioî oæ manù tasks® Whù dï É neeä to exiô froí it¿ Can'ô É configurå mù ZEØ scripô sï thaô iô will allo÷ må tï ruî á fe÷ commands froí thå ZCPR³ commanä line oî my own¬ anä theî continuå witè thå script¿ É haä neveò beforå used ZEØ preciselù iî thió manner¬ tï allo÷ foò useò inpuô froí the ZCPR³ commanä line® Iæ É could¬ however¬ iô woulä leô må dï the abovå erasurå oæ files oò whateveò ió necessarù sï thaô the backuð floppù wilì havå enougè room¬ anä theî returî tï the script. Thió waó aî interestinç challenge® ZEØ haó aî "allo÷ useò input" directivå (^")¬ whicè É naivelù aô firsô thoughô mighô dï the trick® É quicklù realized¬ however¬ thaô thió directivå is primarilù tï allo÷ useò inpuô insidå aî applicatioî program¬ not aô thå command line® Nï matteò ho÷ É tried¬ nï matteò which internaì ZEØ commanä É experimenteä witè É couldn'ô seô iô uð so thaô ZEØ would stoð temporarilù whilå aô thå commanä line¬ query må tï enteò á command¬ anä theî resumå thå script. Wherå tï turn? Thå ZCPR³ utilitù CMD.COÍ poppeä intï mù head® Afteò all¬ this ió itó functionº tï querù foò á commanä anä theî executå it® As yoõ wilì recalì froí mù firsô column¬ iô ió ideaì foò uså inside á SHSEÔ commanä line® However¬ É quicklù discovereä iô ió not meanô foò uså withiî á ZEØ script® ZEØ wilì noô stoð aô CMÄ and properlù waiô foò á useò commanä buô ratheò wilì continuå tï send commandó froí thå ZEØ commanä stream® É aí surå thå reasonó for thió arå verù simplå anä logical¬ thougè theù arå aô thå present unknowî tï me. Enteò ARUNZ® Iî ZCPR3¬ wheî iî doubt¬ looë tï ARUNZ® ARUNZ's "querù foò useò input¢ commanä was á definitå candidatå foò the job® É wondereä iæ ZEØ woulä allo÷ thió featurå tï operate. Thió ió á greatlù simplifieä explanation¬ buô generallù you inserô thå texô yoõ wisè tï displaù tï thå useò betweeî á $¢ and á "¬ anä theî recalì iô lateò iî thå commanä linå witè $'l1® A commoî uså is: $"Enteò á commandº " Thå useò theî enteró hió commanä oò serieó oæ commands¬ complete Šwitè parameteró iæ necessary¬ anä theî thå entirå strinç thaô the useò entereä ió recalleä whereveò iî thå aliaó with thå "$'l1" command. É testeä aî aliaó usinç thió techniquå anä iô workeä perfectly. Aî invocatioî oæ aî ARUNÚ "useò input" aliaó insidå á ZEØ script allowó yoõ tï pauså thå script¬ enteò á commanä tï bå senô to thå commanä processor¬ anä theî resumå tï thå nexô commandó in thå script® Useä insidå BACKUP.ZEØ thió woulä allo÷ må tï enter whateveò commandó necessarù tï eraså fileó froí thå backuð disk, anä theî return. No÷ thaô É haä mù tooló mù plaî oæ actioî begaî tï unfolä as follows: (1) Telì thå useò hió backuð disë ió full. (2© Storå thå namå oæ thå currenô directorù iî memory. (3© Loç oî tï thå BACKUPº directory. (4© Providå á directorù listinç tï allo÷ thå useò tï seå what fileó hå haó there. (5© Providå á meanó tï eraså unneedeä files¬ usinç whatever anä howeveò manù commandó thå useò seeó fitº ERASE.COM, NSWEEP.COM¬ ZFILER.COM¬ etc. (6© Returî tï thå originaì directory. (7© Resumå thå ZEØ scripô wherå lefô ofæ beforå thå disë full erroò occurred. Iî steð fivå É realizeä thaô noô onlù diä É wanô tï givå myself freedoí tï chooså whateveò tooló foò erasinç thaô É wished¬ but thaô É alsï wanteä ZEØ tï loaä uð onå oò twï specifieä utilities thaô woulä facilitatå thaô tasë foò me. Waó thió alì possible¿ Iteí (7© seemeä especiallù challenging. ZEØ didn'ô keeð anù "pointers¢ tï wherå iô waó iî thå script. Thió entirå scenariï certainlù seemeä tï må mucè morå elegant thaî havinç thå ZEØ scripô simplù abort¬ buô waó iô programmable? Firsô É begaî thinkinç abouô whaô commandó É woulä likå tï run tï facilitatå thå tasë oæ erasinç files® Initiallù É thoughô it woulä be nicå tï ruî ZFILEÒ whicè ió generallù thå perfecô tool foò masó filå deletions® Iî case¬ however¬ yoõ haven'ô yeô run intï thió situatioî (manù oæ uó discovereä iô witè WS4)¬ ZCPR3 shelló cannoô reliablù bå ruî froí insidå á multiplå commanä line oò ZEØ script® Iî anù case¬ É decideä aî approacè utilizinç (1) DIR/ERASÅ anä (2© NSWEEÐ woulä bå better® DIÒ anä NSWEEÐ are betteò thaî ZFILEÒ anywaù iî givinç thå useò á betteò grasð of thå relationshið oæ thå sizeó oæ individuaì fileó tï thå total spacå remaininç oî thå disk® ZFILEÒ onlù allowó displaù of individuaì filå sizeó witè á manuaì "F¢ command. É shoulä poinô ouô herå thaô Jaù Sage'ó recenô opinioî that programó sucè aó ZFILEÒ anä thå likå mighô perhapó bå betteò made ZCPR² ratheò than ZCPR³ shelló ió righô oî poinô here» wå would theî bå ablå tï uså iô iî ouò scripô iæ wå wanted. ŠTemporarilù puttinç asidå thå detailó oæ workinç ouô the challengå poseä bù steð (7)¬ É wenô tï work® Aô thå error routinå labeì iî BACKUP.ZEØ É useä thå ^ ;=1 copù a*.ª bakº /ae iæ er reç s± 1 gotï err fi ;=2 copù b*.ª bakº /ae iæ er reç s± 2 gotï err fi ;=3 copù c*.ª bakº /ae iæ er reç s± 3 gotï err fi ;=4 Šcopù d*.ª bakº /ae iæ er reç s± 4 gotï err fi ^ ^? ^ ;=5 copù e*.ª bakº /ae iæ er reç s± 5 gotï err fi . . . etc.... Geô it¿ Whï careó iæ ZEØ haó nï internal pointer¿ Ouò operating systeí ió sï superâ iô provideó enougè serviceó externally¡ We uså registeò ± tï bå ouò external pointeò foò ZEX. Whaô we'vå donå ió uså thå REÇ commanä tï seô registeò ± tï a differenô valuå dependinç oî wherå iî thå alphabeô wå arå iî our copyinç wheî thå disë fulì messagå waó given® Iæ PPIÐ detectó a disë fulì erroò durinç copù oæ thå fileó beginninç witè the letteò "A"¬ PPIÐ itselæ sets thå ZCPR³ erroò flaç anä theî wå set registeò ± ió seô tï "1"® Iæ thå disë fulì ió detecteä during thå copù oæ thå "B¢ files¬ registeò ± ió seô tï "2"¬ anä sï oî up tï "26¢ foò thå "Z¢ files® Theså valueó arå arbitrary» assigning thå numberó ± tï 26 tï thå letteró Á tï Ú simplù makeó thå most sense® Iî otheò words¬ iæ aî erroò ió detected¬ registeò ± will bå seô tï á valuå froí ± tï 2¶ dependinç oî whicè fileó wå have jusô beeî copying. Yoõ maù wondeò ho÷ thió informatioî coulä possiblù bå usefuì to us® Ho÷ caî settinç á registeò -­ á featurå oæ thå command processoò -­ coulä bå usefuì tï ZEØ whicè (unlikå ARUNZ© haó no internaì symboì tï represenô thå contentó oæ thå registers® Jay Sagå haó beeî meaninç (wheî hå pareó hió workdaù dowî to 1¸ from itó currenô 2° hours© tï adä thå entirå ARUNÚ symboì structure, whicè includeó á symboì foò thå valueó helä iî thå registers¬ to ZEX® Untiì thaô sweeô timå comes¬ however¬ wå musô bå inventive. Anä á ZCPR³ programmeò isn'ô wortè hió salô iæ hå ain't creative» thå operatinç systeí surå giveó uó enougè opportunities. Enteò (1© RESOLVE¬ anä (2© onå oæ mù favoritå ruses¬ yå olde "numbers-as-a-character-string¢ routine¬ delveä intï iî some detaiì iî mù lasô column. Paù attentioî tï thå ZEX labeló I'vå added¬ whicè havå thå form ;=labelname¬ thaô É havå inserteä beforå eacè COPÙ command® The namå oæ thå labeì beforå copyinç fileó beginninç witè "A¢ ió "1"; thå labeì juô precedinç thå copù oæ "B¢ fileó ió nameä "2"¬ and sï oî througè Z® Á ZEØ labeì name¬ jusô aó anù filenamå oò in facô mosô anù otheò namå wå uså iî computers¬ maù consisô oæ any Šalphanumeriã characteró anä therå ió nï reasoî wå cannoô use digitó insteaä oæ letters® It'ó thå samå schemå wå uså with settinç thå register® Aô thå labeì nameä "3"¬ wå copù files beginninç witè thå letteò "C¢ anä upoî aî erroò aô thió poinô set registeò ± tï 3® Wå wilì seå shortlù ho÷ handù thió is. Afteò thå INPUTREÔ aliaó haó takeî uó bacë tï ouò ZEØ script¬ the nexô commanä iî BACKUP.ZEØ is: RESOLVÅ GOTÏ $$R1 Remembeò thaô sincå wå arå iî ZEØ á doublå dollaò sigî ió ho÷ we represenô á single dollaò sign» ZEØ stripó ouô thå first® Sï we arå lefô witè '$r1'® Oæ thå manù thingó thaô RESOLVÅ doeó onå of theí ió returî thå valuå oæ anù oæ thå ZCPR³ registeró -­ anä for thió wå shoulä bå gratefuì oò elså thió entirå procedurå could noô work® '$r1' thereforå expandó tï "thå valuå helä iî register 1." No÷ let'ó gï bacë tï ouò scripô anä simulatå á real-life situation® Supposå wå arå backinç uð ouò MEXº directorù anä we arå oî backuð disë numbeò 4® Whilå PPIÐ ió copyinç thå files beginninç witè thå letteò "S¢ iô runó intï á fulì destination disk® Iô setó thå ZCPR³ erroò flaç anä theî ouò ZEØ scripô sets registeò ± tï thå valuå oæ 19® ZEØ theî jumpó tï thå error routinå aô thå bottoí oæ thå ZEØ script® Wå arå tolä thå disë is full¬ wå geô á directorù anä arå askeä whicè fileó we'ä likå to erase® Wå eraså á filå oò twï here® NSWEEÐ loadó anä sincå we arå ablå tï uså itó V)ie÷ commanä wå seå á fe÷ morå fileó that arå redundant¬ thougè we'rå noô absolutelù surå yeô wå have enougè space oî thå backuð disë tï confidentlù returî tï thå ZEX copyinç routines. Wå nexô takå advantagå oæ thå INPUÔ alias¬ whicè allowó uó tï run anù prograí oæ ouò choosing¬ tï ruî Carsoî Wilson'ó FÄ which giveó uó á betteò senså oæ whicè fileó oî thå disë arå most recent® Wå uså thió ne÷ informatioî abouô datestampó to determinå thaô therå ió onå verù largå anä olä filå foò which we nï longeò havå anù use¬ anä thereforå aô thå final¬ INPUTRET prompô eraså it® Wå arå theî finallù returneä tï ZEX® Aô this poinô thå nexô commanä ZEØ encounteró ió 'RESOLVÅ GOTÏ $$R1'. Sincå registeò ± ió seô tï 19¬ thió commanä wilì expanä (or "resolve"© tï "GOTÏ 19"¬ whicè meanó gï tï thå ZEØ labeì named "19"® Again¬ therå ió nï reasoî wå cannoô havå á labeì named "19"¬ eveî thougè labeì nameó arå usually composeä oæ letteró and noô numbers® Ouò labeì "name¢ noô sï coincidentallù happenó to bå thå numericaì valuå helä iî ZCPR³ registeò 1¬ anä thió suits RESOLVÅ jusô fine® Anä -­ whaô dï yoõ kno÷ -­ labeì 1¹ just happenó tï bå aô thå "COPÙ S*.ª BAKº /AE¢ command® Sï GOTO returnó uó exactlù tï wherå wå werå iî thå ZEØ scripô beforå the erroò occurred. Neat¬ huh¿ É haä donå whaô I'ä seô ouô tï do. ŠNeveò onå tï givå myselæ anù rest¬ however¬ á daù oò sï lateò the thoughô camå tï må (á classiã symptoí oæ thaô dreadeä disease thaô programmeró get¬ "feature-itis")º wouldn'ô iô bå nicå iæ we coulä geô á messagå flashinç oî thå screen: RETURNINÇ TÏ THÅ "S¢ FILES... jusô beforå thå actuaì return¿ Sure¬ É said» whù not? Buô ho÷ tï dï it¿ How¬ where¬ anä whaô coulä possiblù senä tï us thió "S,¢ anä ho÷ woulä wå store¬ keeð tracë oæ anä lateò access it¿ Coulä PPIÐ possiblù senä thió letteò tï uó somehow¿ Iæ not PPIP¬ theî what¿ É challengå anyonå whï doesn'ô thinë iî terms oæ RESOLVÅ anä shelì variableó tï comå uð witè á solution¬ short oæ writinç á ne÷ program... Thå ideá ió tï creatå á *.VAÒ filå thaô matcheó letteró with numbers® Iî otheò words¬ we'rå goinç tï seô uð á situatioî in whicè wheî RESOLVÅ findó thå strinç '%19§ iô wilì givå uó the letteò 'S'® Here'ó whaô wå do® We'rå goinç tï definå some variableó intï ouò SH.VAÒ file® Thió timå I'í noô goinç to botheò defininç anotheò *.VAÒ filå aó thå currenô one. Wå uså SHDEFINÅ aó "SHDEFINÅ SH.¢ Notå thaô witè SHDEFINÅ eveî if anotheò variablå filå ió currentlù defineä tï thå systeí wå can specifù aó á commanä linå parameteò thå particulaò filå tï which wå woulä likå tï adä oò replacå variables® Usinç SHDEFINE's E)diô commanä wå adä thå followinç variableó anä definitions, startinç froí wherå variablå '1§ ½ definitioî 'A§ anä goinç all thå waù tï variablå '26§ ½ definitioî 'Z'. VARIABLE NAMÅ DEFINITION -------­ ---------- ± "A" ² "B" ³ "C" ´ "D" µ "E" ¶ "F" . . . anä sï on¬ untiì 2¶ anä "Z"® Now¬ wå caî adä onå morå commanä to ouò INPUTREÔ aliaó describeä abovå (RESOLVE.COÍ ió alwayó renamed tï RS.COM): RÓ ECHÏ RETURNINÇ TÏ WHERÅ WÅ WERÅ -­ AÔ THÅ %$RF0± FILES... anä thå entirå aliaó becomes: INPUTREÔ $¢ Enteò youò finaì commanä ('oò EXIT§ tï exiô ZEØ << completely)º "$'l1;iæ eñ $'l± exit;echï returninç tï << zcpr3...;pusè !;else;ró echï returninç tï wherå wå werå << -­ aô thå %$rf0± files...;holä 2;fi ŠDon'ô worrù abouô thå lengtè oæ thió alias¬ eveî iæ witè your editoò iô exceedó 20° characters¬ thå numbeò normallù associated witè thå limiô oæ thå commanä linå buffer® Anù texô iî thå 'user input§ parô oæ thå aliaó ió not placeä iî thå commanä linå buffer anä shoulä thereforå noô bå counted towardó thå 20° characters. Caî yoõ understanä thió alias¿ Iô ió similaò to¬ buô slightly differenô froí thå RESOLVÅ GOTÏ $$R± commanä wå puô iî ouò ZEX script® Herå wå arå relyinç oî ARUNZ'ó anä noô RESOLVE's register-expansioî facilities¬ anä thå syntaø ió slightly different® Herå iî aî ARUNÚ scripô iî whicè wå wanô tï represent "thå contentó oæ registeò 1¢ wå musô follo÷ thå "R¢ (standó for Register¬ oæ course© witè aî "optioî letter,¢ followeä iî turî by thå registeò number® Ouò "F¢ optioî meanó "floatinç decimal," whereaó iæ thå numbeò ió onå digiô long¬ wå wanô iô represented aó onå digiô only¬ anä iæ twï digitó iô shoulä appeaò aó exactly two¬ anä similarlù witè three® Iî otheò words¬ don'ô givå uó any leadinç zeroes¬ onlù thå ra÷ number® Wheî RESOLVÅ returnó the contentó oæ á registeò iô neveò putó leadinç zeroes» ARUNZ's optioî letteró allo÷ iô oò not. Bù thå way¬ iô shoulä bå noteä thaô RESOLVÅ cannoô expanä both thå registeò valuå ANÄ thå ensuinç anä contingenô strinç variable (thaô thå registeò valuå theî becomes)® Therefore¬ wå cannoô put thió commanä insidå thå ZEØ file» wå musô puô iô intï ARUNÚ where wå caî relù oî ARUNZ'ó registeò expansioî symboì anä leavå the variablå expansioî uð tï RESOLVE® Unlikå iî ouò firsô uså of RESOLVÅ wherå iô expandó thå registeò contents¬ herå ARUNÚ does so. Witè ouò registeò ± stilì seô tï 1¹ ARUNÚ resolveó thå register symboì '$rf01§ anä ouò commanä theî becomes: RESOLVÅ ECHÏ RETURNINÇ TÏ WHERÅ WÅ WERÅ -­ AÔ THÅ %1¹ FILES... No÷ RESOLVE'ó variable-expansion¬ anä noô itó register- expansioî facilitù comeó intï play® ARUNÚ haó senô iô thå string "%19.¢ Remembeò thaô wheî RESOLVÅ seeó á '%§ iô knowó thaô a nameä shelì variablå ió tï follow® Iô knowó thereforå tï look in thå currentlù defineä shelì variablå file¬ defaulteä tï SH.VAR unlesó wå havå defineä iô otherwiså witè SHFILE.COÍ (wå haven't), anä determinå thå definitioî thaô haó beeî giveî tï that variable® Thaô definitioî ió theî returneä tï uó foò ouò use. Sï RESOLVÅ theî lookó intï SH.VAÒ foò á variablå nameä "19"® And whaô doeó iô find¿ Oæ courså -­ thå letteò 'S'. Ouò commanä linå ió thereforå expandeä to ECHÏ RETURNINÇ TÏ WHERÅ WÅ WERÅ -­ AÔ THÅ "S¢ FILES ECHÏ presentó thió lovelù anä informativå messagå tï uó oî the screen¬ wå arå tickleä pinë thaô ouò operatinç systeí ió so elegant¬ anä finallù controì ió passed bacë tï thå exacô poinô in ZEØ wherå wå thå disë fulì messagå firsô occurreä anä where RESOLVE¬ GOTO¬ ZCPR³ registeró anä ZEX labeló teaí uð tï makå us Šfeeì incrediblù gratefuì foò thió worë oæ arô calleä ZCPR3. Beforå closing¬ I'ä likå tï mentioî thaô iî thå lasô fe÷ monthó I havå beeî experimentinç furtheò iî thå veiî oæ lasô column's topic¬ writinç morå anä morå programó tï storå variouó dateó in shelì variablå files® Aó á resulô É havå comå uð witè something É believå wilì bå verù handù foò useró oæ thå PC-Pursuiô network. Untiì no÷ monthlù uså oî PCÐ haó beeî unlimited® Beginninç on Maù ± howeveò thaô wilì alì change® Therå wilì theî bå á monthly limiô oæ 3° hours¬ afteò whicè anù uså wilì bå chargeä oî a per-timå basis. É aí surå thaô useró oæ MS-DOÓ communicatioî programó havå been busilù rewritinç theiò scriptó anä utilitieó tï bå ablå tï keep tracë oæ theiò monthlù timå sï thå useò wilì bå alerteä when approachinç thå 3° houò limit® No÷ foò thoså ZCPR³ useró whose systemó includå datestamping¬ á real-timå clocë anä the extraordinarù modeí prograí MexPluó abouô whicè É wrotå á bit lasô time¬ É havå updateä mù PCÐ MexPluó scripô sï thaô iô will keeð tracë oæ monthlù PC-Pursuiô time® Iô storeó houró and minuteó temporarilù iî thå ZCPR³ registers» wheî thå computeò is turneä ofæ theù gï intï (wherå else?© shelì variablå *.VAÒ files. Thankó tï ARUNZ§ datå symbols¬ thå *.VAÒ fileó arå changeä each montè anä thå timå counô beginó anew. Thoså whï arå interesteä iî thió script¬ oò foò thaô matter anythinç elså abouô whicè É writå iî mù columns¬ maù writå me carå oæ TCJ® I'ä alsï bå glaä tï senä á copù oæ thå entire BACKUP.ZEØ script¬ eitheò thå generiã versioî oò mù personaì copy configureä especiallù tï takå advantagå oæ thå extendeä graphic anä videï capabilitieó oæ thå Qumå 102á terminal. Ú yoõ nexô time... ----------------------- LISTINÇ OÆ BACKUP.ZEØ ERROÒ ROUTINE: goto enä » iæ nï error ;=err zif if er · » CTL-Ã entereä goto errseveî fi ^[ZEX has detected that the BACKUP disk is full.^] saë /p² » leavå messagå oî screeî foò ² seconds push backupº » loç tï backuð directory dir /inputerá » ruî 'ERASE§ alias ^[^|^|Loading NSWEEP might help, so you can view your files...^|^] nó » NSWEEP /input /inputret Špush ! rs goto $$r± » returî tï wherå wå lefô off ;=errseven ^[^|Abort request detected, ZEX script terminating...^|^] zif ;=end