home *** CD-ROM | disk | FTP | other *** search
- ; ----------------------------------
- | |
- | ZFILER's Script Macro Facility |
- | |
- ----------------------------------
-
-
- M >> Introduction to ZFILE╥'s Macros
-
-
- << Macro Execution >> << Macro Writing >>
-
- I >> Invokinτ Macros S >> Macr∩ Scripts
- G >> Group Macros D >> Defininτ Macro≤ -- Thσ CM─ File
- R >> Rule≤ fo≥ Scrip⌠ Expansion
- E >> Macr∩ Examples
- L >> Sample Macro CMD Listing
- :M
- Introduction to ZFILE╥'s Macros
-
- AlthougΦ ZFILE╥ caε accomplisΦ man∙ task≤ usinτ it≤ built-iε functions¼ ì
- it≤ rea∞ powe≥ come≤ froφ thσ macr∩ facility¼ whicΦ allow≤ i⌠ t∩ bσ extendeΣ ì
- t∩á includσ an∙ function≤ tha⌠ caε bσ performeΣ usinτ combination≤ oµá othe≥ ì
- programs«á Thi≤á i≤ wherσ ZFILE╥ reall∙ make≤ usσ oµ it≤ powe≥ a≤ ßá shell« ì
- Firs⌠á ╔á wil∞á describσ ho≈ thσ macr∩ facilit∙ i≤ used¼á anΣá theεá ╔á wil∞ ì
- describσá ho≈á thσ use≥ define≤ thσ macr∩ functions«á A≤ witΦ thσá built-iε ì
- functions¼á macr∩ function≤ caε operatσ eithe≥ oε singlσ file≤ o≥ oεá group≤ ì
- oµ files«á Thσ single-filσ macr∩ facilit∙ i≤ wel∞ developeΣ anΣ wa≤ alread∙ ì
- presen⌠á iε nearl∙ thσ samσ forφ iε VFILER╗á thσ grou≡ macr∩ facilit∙ i≤ ne≈ ì
- witΦ ZFILE╥ and has been greatly expanded.
- :I
- Invokinτ Macros
-
- Onσá wa∙á t∩ initiatσ ß macr∩ operatioε oε thσ pointed-t∩á filσá i≤á t∩ ì
- pres≤ thσ macr∩ invocatioε key¼á whicΦ i≤ normall∙ thσ escapσ key« ┴ promp⌠ ì
- oµá "Macro:óá wil∞ appea≥ afte≥ thσ norma∞ ZFILE╥ commanΣ prompt«á A⌠á thi≤ ì
- poin⌠á yo⌡ havσ severa∞ choices«á Iµ yo⌡ kno≈ thσ ke∙ correspondinτ t∩á thσ ì
- macr∩ yo⌡ wan⌠ t∩ run¼ theε yo⌡ caε simpl∙ pres≤ tha⌠ key« ZFILE╥ wil∞ theε ì
- construc⌠á ßá commanΣá linσá anΣ pas≤ i⌠ oε t∩á thσá commanΣá processo≥á fo≥ ì
- execution«á Iµá ZFILE╥á i≤á configureΣá fo≥á instan⌠á macr∩á operatioεá (i⌠ ì
- generall∙ is)¼á theε macro≤ associateΣ witΦ thσ numbe≥ key≤ "0ó througΦá "9ó ì
- caε bσ initiateΣ withou⌠ thσ macr∩ invocatioε key╗á tha⌠ is¼á thσ numbe≥ ke∙ ì
- entereΣá alonσá a⌠á thσ maiε ZFILE╥ commanΣ promp⌠ wil∞ generatσá thσá macr∩ ì
- function.
-
- Iµ yo⌡ pres≤ thσ macr∩ invocatioε ke∙ ß seconΣ time¼á ß user-createΣ hel≡ ì
- screeεá wil∞ bσ displayed«á Thi≤ screeε generall∙ list≤ thσ availablσ macr∩ ì
- functions«á Yo⌡ caε no≈ pres≤ thσ ke∙ fo≥ thσ desireΣ function¼á o≥ yo⌡ caε ì
- pres≤á carriagσ returε t∩ cance∞ thσ macr∩ operatioε anΣ returε t∩ thσá maiε ì
- ZFILE╥ menu«á Thσ hel≡ men⌡ screeε wil∞ als∩ bσ displayeΣ iµ yo⌡ pres≤á thσ ìè"#óá key«á Thi≤ i≤ ß holdove≥ froφ VFILE╥ anΣ arise≤ iε par⌠ becausσ oµ thσ ì
- structurσá oµá thσá filσá iε whicΦ thσ macro≤á arσá defineΣá (morσá oεá thi≤ ì
- shortly).
- :G
- Group Macros
-
- Grou≡á macro≤á arσá invokeΣ iε ß simila≥ wa∙ froφá thσá grou≡á functioε ì
- commanΣ line«á Afte≥ yo⌡ havσ taggeΣ ß grou≡ oµ files¼ pres≤ thσ "Gó ke∙ t∩ ì
- ente≥á grou≡ mode«á Thσ promp⌠ wil∞ lis⌠ onl∙ thσ built-iε grou≡ functions¼ ì
- bu⌠á iµá yo⌡ pres≤ thσ macr∩ invocatioε key¼á yo⌡ caε proceeΣá a≤á describeΣ ì
- abovσ fo≥ single-filσ macr∩ operations¼á excep⌠ tha⌠ thσ macr∩ functioε wil∞ ì
- bσ performeΣ oε eacΦ oµ thσ taggeΣ files.
-
- Thσá grou≡ macr∩ facilit∙ work≤ ß littlσ differentl∙ thaεá thσá single-ì
- filσá macr∩á facility«á Sincσ thσ commanΣ linσ woulΣ generall∙ no⌠ bσá lonτ ì
- enougΦá t∩ contaiε thσ command≤ fo≥ al∞ thσ taggeΣ files¼á thσá grou≡á macr∩ ì
- facilit∙á work≤ b∙ writinτ ou⌠ ß batcΦ filσ fo≥ processinτ b∙ ZE╪ o≥ SUBMIT« ì
- Iεá thi≤á wa∙ therσ i≤ virtuall∙ n∩ limi⌠ t∩ thσ numbe≥ oµá file≤á oεá whicΦ ì
- grou≡ macro≤ caε operate.
- Therσ arσ man∙ configurablσ option≤ (describeΣ below⌐ tha⌠ arσ associateΣ ì
- witΦá thσ grou≡ macr∩ operation«á Thesσ includσ thσ namσ oµ thσ ZE╪ o≥á SU┬ ì
- batcΦ file¼á thσ director∙ t∩ whicΦ i⌠ i≤ written¼ anΣ thσ commanΣ linσ tha⌠ ì
- ZFILE╥á generate≤á t∩ initiatσ thσ batcΦ operation«á Thσ NZ-CO═ versioεá oµ ì
- ZFILE╥ use≤ ß filσ calleΣ ZFILER.ZE╪ anΣ thσ commanΣ linσ "ZE╪ ZFILER"« Thσ ì
- Z3PLU╙ version¼á unde≥ whicΦ ZE╪ wil∞ no⌠ run¼ use≤ ß filσ calleΣ ZFILER.SU┬ ì
- anΣ ß commanΣ linσ oµ "SUBMI╘ ZFILER".
-
- Sincσ macro≤ (anΣ thσ maiε men⌡ "Zó function⌐ worδ b∙ passinτá command≤ ì
- t∩á thσá commanΣ processor¼á filσ tag≤ werσ oncσ los⌠ b∙ olde≥á version≤á oµ ì
- ZFILER╗á wheεá thesσ olde≥ version≤ resumeΣ operation¼á thσ proces≤á starteΣ ì
- afresh« ZFILE╥ no≈ remember≤ al∞ thσ filσ tag≤ wheε i⌠ return≤ froφ ß macr∩ ì
- o≥ ┌ commanΣ (i⌠ write≤ ß temporar∙ file¼á "ZFILER.TAG"¼á t∩ ßá configurablσ ì
- director∙ whicΦ contain≤ thσ filσ list).
- List Capability for Group Macros
-
- Iµ ß ZFILER.CM─ scrip⌠ begin≤ witΦ ß commß (beforσ o≥ afte≥ thσ leadinτ ì
- "!ó shel∞ pausσ parameter)¼á ZFILE╥ wil∞ alway≤ expanΣ thσ macr∩ directl∙ t∩ ì
- ZCPR'≤ multiplσ commanΣ line«á Iε thσ casσ oµ ß grou≡ macro¼ $P¼ $F¼ anΣ $╘ ì
- parameter≤á arσá expandeΣ t∩ ß lis⌠ oµ al∞ taggeΣ files¼á separateΣá b∙á thσ ì
- characte≥ followinτ thσ leadinτ comma«
-
- For example, the script:
-
- 1 , !echo the tagged files are $F
-
- display≤á "TH┼á TAGGE─ FILE╙ AR┼ "¼á followeΣ b∙ ß lis⌠ oµ thσ taggeΣá file≤ ì
- separateΣá b∙á ó ó oε thσ consolσ (assuminτ ECH╧ i≤ ß valiΣá ZCP╥á command)« ì
- ZFILE╥ theε prompt≤ fo≥ ß keypres≤ beforσ returning«á Pleasσ notσ tha⌠ thi≤ ì
- macr∩ buffer≤ thσ entirσ lis⌠ oµ taggeΣ file≤ t∩ CP/M'≤ commanΣ linσ buffer¼ ì
- whicΦ i≤ onl∙ 12╡ byte≤ iε length«á Thσ abovσ command¼á therefore¼ normall∙ ì
- cause≤á ßá "CommanΣ to∩ longó erro≥ iµ morσ thaε abou⌠ ╕ file≤á arσá tagged¼ ì
- dependinτ oε thσ length≤ oµ thσ taggeΣ names.
-
- Lis⌠ capabilit∙ allow≤ program≤ whicΦ accep⌠ ß filσ list¼á sucΦ a≤ LPU╘ ì
- o≥ V¼ t∩ ruε oε taggeΣ files« ZE╪ i≤ NO╘ involved.
- Group Macro Tagged File Count
-
- Thσá numbe≥ oµ file≤ taggeΣ i≤ pu⌠ int∩ Use≥ Registe≥ #╡ (configurable⌐ ì
- beforσ runninτ ZEX«á Thσ macr∩ caε theε dowε coun⌠ anΣ takσ somσ additiona∞ ì
- actioε afte≥ i⌠ ha≤ ruε oε eacΦ taggeΣ file.
-
- For example, if you press "G<ESC>1", the script:
-
- 1 ! $d$u:;$!crunch $f B1:;reg m5;if reg 5= 0;$"Library DU ":;
- lput $"Library Name: " B1:*.* +1;era B1:*.?Z?;fi;$h:
-
- crunche≤ taggeΣ file≤ t∩ ß fixeΣ empt∙ director∙ B1:¼ make≤ ß librar∙ ou⌠ oµ ì
- theφá (leavinτá rooφá fo≥á ▒ morσ file⌐ witΦá inpu⌠á fo≥á librar∙á namσá anΣ ì
- location¼á theεá erase≤ al∞ "thσ crunchettes"«á Thi≤ macr∩ require≤ RE╟á t∩ ì
- decremen⌠ Registe≥ 5.
-
- Notσá tha⌠ RE╟ mus⌠ bσ ß Type│ o≥ Type┤ (o≥ RCP⌐ fo≥ thσ ZE╪ G╧ "$!ó t∩ ì
- ruε CRUNC╚ repeatedly« Als∩ notσ tha⌠ register≤ onl∙ holΣ ß 25╡ countí Fo≥ ì
- consistency¼á singlσá macro≤á pu⌠ ß "1ó coun⌠ iε thσá Use≥á Register«á Use≥ ì
- registe≥ rangσ 0..╣ i≤ no⌠ enforced¼á s∩ yo⌡ caε usσ register≤ 10..3▒ iµ yo⌡ ì
- wish« However¼ 10-1╡ arσ reserved¼ while 16-1╖ arσ useΣ b∙ other programs.
- :S
- ü Macr∩ Script≤
-
- ZFILE╥á macr∩á script≤ arσ simila≥ t∩ thosσ iε ARUN┌ anΣ iεá thσá othe≥ ì
- men⌡á shell≤á (MENU¼á VMENU¼á FMANAGER⌐á iε tha⌠ paramete≥á expression≤á caε ì
- appear«á Thσá critica∞ parameter≤ -- thσ one≤ tha⌠ implemen⌠ function≤á tha⌠ ì
- canno⌠ bσ achieveΣ an∙ othe≥ wa∙ -- arσ thosσ tha⌠ conve∙ informatioεá abou⌠ ì
- thσá director∙ currentl∙ displayeΣ b∙ ZFILE╥ anΣ abou⌠ thσ pointed-t∩á file« ì
- Parameter≤á consis⌠á oµá ß "$ó characte≥ followeΣ b∙ onσ oµá thσá character≤ ì
- listeΣ below.
- Use≥ promp⌠ parameters:
-
- º Use≥ inpu⌠ prompt
- ó Use≥ inpu⌠ prompt
- * Clear screen in user prompt
- $ Escape character (example: '$"' for double quote)
- ^ Control character (example: '^x' for control-X)
-
-
- Parameter≤ fo≥ directories:
-
- - currentl∙ displayeΣ directory
- ├ DI╥ form
- ─ Drivσ letter
- ╒ Use≥ number
-
- - homσ director∙ (froφ where ZFILE╥ wa≤ invoked)
- ╚ D╒ form
- ╥ Homσ DIR
- Parameter≤ fo≥ pointed-t∩ file:
-
- ╨ Ful∞ informatioε (DU:FN.FT)
- ╞ Filσ namσ (FN.FT)
- ╬ Filσ namσ only
- ╘ Filσ typσ only
-
- Specia∞ parameters:
-
- í G╧ substitutioε indicator
- ñ Thσ dolla≥ character
-
- Thσ parameter≤ arσ listeΣ iε ß specia∞ orde≥ above¼ anΣ wσ wil∞ explaiε ì
- tha⌠ later« Firs⌠ wσ wil∞ jus⌠ presen⌠ thσ meaninτ fo≥ eacΦ parameter.
-
- Thσá paramete≥á expression≤á $ó anΣ $º arσ useΣá t∩á displa∙á ßá promp⌠ ì
- messagσá t∩á thσ use≥ anΣ t∩ reaΣ iε ß responsσ string«á Singlσ anΣá doublσ ì
- quote≤á arσ equivalent«á Oncσ thσ promp⌠ paramete≥ ha≤ beeεá detected¼á al∞ ì
- subsequen⌠ character≤ u≡ t∩ onσ oµ thσ quotσ character≤ arσ displayeΣ a≤ thσ ì
- use≥ prompt«á Thus¼á iµ ╔ aφ no⌠ mistaken¼ therσ i≤ presentl∙ n∩ wa∙ t∩ pu⌠ ì
- eithe≥ quotσ characte≥ int∩ thσ prompt«á Thσ enΣ oµ thσ linσ o≥ thσ enΣá oµ ì
- thσ filσ wil∞ als∩ terminatσ thσ prompt.
- Iµ yo⌡ wan⌠ t∩ makσ fanc∙ screens¼ yo⌡ caε includσ escapσ sequence≤ anΣ ì
- somσ contro∞ character≤ (obviousl∙ carriagσ returε won'⌠ work)«á Prompt≤ iε ì
- script≤á ma∙á contaiε contro∞ character≤ a≤ "^x"¼á wherσ ° i≤ an∙á characte≥ ì
- froφ └ t∩ z.
-
- Thσá dolla≥ sigε ma∙ bσ useΣ aε "escapσ characteró fo≥ scrip⌠á prompts¼ ì
- anΣ caε be used to include the $, ^, ", and ' characters in prompts.
-
- Examples:
- Script Result
- $"Enter name or $^C: " Enter name or ^C:
- $"Type $"//$" for help: " Type "//" for help:
-
- Thσ $¬ scrip⌠ paramete≥ clear≤ thσ screeε during¼ anΣ rebuild≤ i⌠ afte≥ ì
- ß scrip⌠ prompt« Usagσ i≤ $"$*..text.."« Promp⌠ tex⌠ appear≤ a⌠ thσ to≡ oµ ì
- ß cleared screen.
- No≈á fo≥á thσ director∙ parameters«á Parameter≤ C¼á D¼á anΣá ╒á returε ì
- informatioεá abou⌠ thσ currentl∙ displayeΣ directory¼á whilσ ╚ anΣ ╥á returε ì
- informatioεá abou⌠á thσá homσá directory¼á thσ onσá froφá whicΦá ZFILE╥á wa≤ ì
- originall∙á invoked«á PLEAS┼á NOTE║á macro≤ alway≤ operatσá froφá thσá homσ ì
- directory«á Thσ reasoε fo≥ thi≤ i≤ tha⌠ ZFILE╥ caε displa∙ directorie≤ witΦ ì
- use≥á number≤ highe≥ thaε 1╡ eveε wheε i⌠ i≤ no⌠ possiblσ t∩ loτ int∩á thesσ ì
- areas«á Iµ yo⌡ wan⌠ t∩ operatσ iε thσ displayeΣ directory¼ theε you≥ scrip⌠ ì
- mus⌠ includσ aε explici⌠ directory-changσ commanΣ oµ thσ forφ "$D$U:ó a⌠ thσ ì
- beginninτá (o≥á "$C:ó iµ you≥ systeφ require≤ thσ usσ oµ nameΣá directories⌐ ì
- anΣ ß commanΣ oµ thσ forφ "$H:ó (o≥ "$R:"⌐ a⌠ thσ end.
-
- Onσ specia∞ notσ abou⌠ thσ parameter≤ tha⌠ returε director∙ names«á Iµ ì
- thσ director∙ ha≤ n∩ name¼á theε thσ strinτ "Nonameó i≤ returned« Thi≤ wil∞ ì
- presumabl∙ no⌠ matcΦ an∙ actua∞ namσ anΣ wil∞ lead¼á onσ hopes¼á t∩ ß benigε ì
- erro≥ condition« Thesσ parameter≤ arσ includeΣ onl∙ fo≥ system≤ tha⌠ d∩ no⌠ ì
- allo≈ directorie≤ t∩ bσ indicateΣ usinτ thσ D╒ forφ (╔ hopσ tha⌠ fe≈ iµá an∙ ì
- system≤ arσ se⌠ u≡ thi≤ way).
- No≈á wσá comσá t∩á thσ fou≥ filσ namσ parameters«á The∙á allo≈á u≤á t∩ ì
- generatσá easil∙ thσ completσ filσ specificatioε o≥ an∙ par⌠á oµá it«á Notσ ì
- tha⌠á "$Fó i≤ no⌠ quitσ thσ samσ a≤ "$N.$T"«á Thσ latte≥ alway≤ contain≤á ß ì
- dot╗ thσ forme≥ doe≤ no⌠ iµ thσ filσ ha≤ n∩ filσ type.
-
- Finally¼á wσ havσ tw∩ specia∞ parameters«á "$$ó i≤ includeΣ t∩ allo≈ ß ì
- dolla≥á sigεá characte≥ t∩ bσ entereΣ int∩ thσ script«á "$!ó i≤á ßá contro∞ ì
- paramete≥ tha⌠ i≤ useΣ onl∙ wheε ß grou≡ macr∩ i≤ executed« Iµ i⌠ i≤ placeΣ ì
- immediatel∙á beforσá ß tokeε (strinτ oµ contiguou≤á characters)¼á theεá tha⌠ ì
- tokeεá wil∞ bσ replaceΣ b∙ thσ strinτ "GOó oε al∞ bu⌠ thσ firs⌠ expansioε oµ ì
- thσ script«á Thi≤ allow≤ grou≡ macr∩ script≤ t∩ operatσ faste≥ b∙á avoidinτ ì
- repetitivσá loadinτá oµá ß CO═ file«á I⌠ mus⌠ bσ useΣ witΦ grea⌠á carσá anΣ ì
- consideration¼ however¼ fo≥ reason≤ tha⌠ ╔ wil∞ no⌠ g∩ int∩ here.
- :D
- ü Defininτ Macro≤ é -- Thσ CM─ File
-
- No≈á let'≤á learεá ho≈ t∩ definσ thσ macr∩ function≤á wσá want«á A≤á ╔ ì
- indicateΣ earlier¼ thσ macro≤ arσ defineΣ iε ß filσ calleΣ "ZFILER.CMDó (thσ ì
- ZFILE╥ ComMan─ file)«á Iε thσ versioε oµ ZFILE╥ distributeΣ witΦ NZ-CO═ anΣ ì
- Z3PLUS¼á thσá CM─á filσ i≤ searcheΣ fo≥ iε thσ roo⌠ director∙ oµá thσá ZCPR│ ì
- commanΣá searcΦá path«á A≤ describeΣ earlier¼á thσ optioε men⌡á allow≤á thσ ì
- entirσ patΦ t∩ bσ used« Therσ arσ als∩ somσ additiona∞ configurablσ option≤ ì
- tha⌠á wil∞á bσá discusseΣá anothe≥á time«á Yo⌡ mus⌠ bσá surσá t∩á pu⌠á you≥ ì
- ZFILER.CM─á filσá iεá thσ appropriatσ directory«á Iµá thσá filσá canno⌠á bσ ì
- located¼á yo⌡ wil∞ stil∞ ge⌠ thσ macr∩ prompt¼ but¼ afte≥ yo⌡ havσ specifieΣ ì
- ß macr∩ key¼ thσ erro≥ messagσ "ZFILER.CM─ NO╘ Foundó wil∞ bσ displayed.
-
- Thσá ZFILER.CM─ filσ i≤ aε ordinar∙ tex⌠ filσ tha⌠ yo⌡ caε creatσá witΦ ì
- an∙á edito≥á o≥ wordprocesso≥ tha⌠ caε makσ plaiε ASCI╔ file≤á (WordSta≥á iε ì
- nondocumen⌠ mode¼ fo≥ example)« Thσ CM─ filσ ha≤ tw∩ parts« Thσ firs⌠ par⌠ ì
- contain≤ thσ macr∩ commanΣ definitions╗á thσ seconΣ contain≤ thσ hel≡ screeε ì
- (describeΣ earlier).
- Iεá thσ firs⌠ par⌠ oµ thσ CM─ file¼á eacΦ linσ define≤á ßá macro«á Thσ ì
- characte≥á iεá thσ firs⌠ columε i≤ thσ ke∙ associateΣ witΦá tha⌠á definitioε ì
- (casσá doe≤ no⌠ matter)«á Macro≤ caε bσ associateΣ witΦ thσ 1░ numbe≥ keys¼ ì
- 2╢á lette≥á keys¼á anΣá al∞á printablσ specia∞á character≤á excep⌠á fo≥á "#ó ì
- (explaineΣ below)«á Thσ spacσ characte≥ anΣ al∞ contro∞ character≤ arσá no⌠ ì
- allowed«á Owinτá t∩á aεá oversight¼á thσá rubou⌠á (DEL⌐á characte≥á caεá bσ ì
- associateΣ witΦ ß macro!
-
- Afte≥á thσá characte≥ tha⌠ name≤ thσ macr∩ therσ ma∙ bσ an∙á numbe≥á oµ ì
- blank≤ (includinτ zero)«á Iµ thσ firs⌠ non-blanδ characte≥ i≤ "!"¼ theε thσ ì
- "strikσá an∙ keyó (shell-wait⌐ promp⌠ wil∞ appea≥ beforσ ZFILE╥ put≤ u≡á thσ ì
- filσ displa∙ afte≥ ß macr∩ commanΣ i≤ run« Thi≤ shoulΣ bσ useΣ wheneve≥ thσ ì
- macr∩á wil∞á leavσá informatioε oε thσ screeε tha⌠ yo⌡ wil∞á wan⌠á t∩á read« ì
- Afte≥á thσ "!ó therσ caε agaiε bσ an∙ numbe≥ oµ spaces«á An∙ remaininτ tex⌠ ì
- oε thσ linσ i≤ takeε a≤ thσ scrip⌠ fo≥ thσ macr∩ command.
- Thσá seconΣ par⌠ oµ thσ CM─ filσ start≤ wheε ß "#ó characte≥ i≤ founΣá iε ì
- thσá firs⌠á columε (hencσ thσ exclusioε oµ tha⌠ characte≥ a≤ ß macr∩á name)« ì
- Oncσ tha⌠ characte≥ appears¼ al∞ remaininτ text¼ includinτ tex⌠ oε thσ line¼ ì
- wil∞ bσ useΣ a≤ thσ hel≡ screen«á Sincσ ZFILE╥ wil∞ adΣ somσ informatioε t∩ ì
- thσá displa∙á (thσá namσ oµ thσ pointed-t∩ filσá anΣá ßá prompt)¼á yo⌡á wil∞ ì
- generall∙á wan⌠ t∩ kee≡ thσ hel≡ screeε t∩ n∩ morσ thaε 2░ lines¼á includinτ ì
- aε extrß blanδ linσ a⌠ thσ enΣ fo≥ spacing«á WitΦ somσ experimentatioεá yo⌡ ì
- wil∞ ge⌠ thσ hanτ oµ designinτ thi≤ screen.
-
-
- Here is a parameter reminder you can include in your ZFILER.CMD file:
-
- $! ZEX 'GO' $P DU:FN.FT $D Current Drive
- $".." PROMPT $F FN.FT $U Current User
- $'..' PROMPT $N FN $C Current DIR
- $* CLS on Prompt $T FT $H Home DU $R Home DIR
- :R
- ü Rule≤ fo≥ Scrip⌠ Expansioε
-
- ZFILE╥á follow≤ ß specifiπ sequencσ oµ step≤ wheε expandinτá ßá script¼ ì
- onσ tha⌠ give≤ i⌠ ß specia∞ featurσ that¼ ╔ woulΣ guess¼ fe≈ user≤ arσ awarσ ì
- of«á Thσá firs⌠á ste≡á iε thσ expansioε i≤ t∩ proces≤ onl∙á thσá user-inpu⌠ ì
- promp⌠ parameters¼á substitutinτ fo≥ thσ promp⌠ whateve≥ thσ use≥ entereΣ iε ì
- response«á Thi≤ result≤ iε ß modifieΣ scrip⌠ tha⌠ i≤ theε processeΣ b∙á thσ ì
- seconΣá ste≡ iε thσ expansion«á Becausσ thσ expansioε i≤ handleΣ thi≤á way¼ ì
- thσ use≥ inpu⌠ caε includσ ZFILE╥ scrip⌠ parametersíá Thus¼á thσ scrip⌠ caε ì
- bσ useΣ t∩ writσ ß script« Yo⌡ wil∞ seσ aε examplσ oµ thi≤ later.
-
- Thσá seconΣá ste≡á iεá thσ expansioε i≤ t∩ substitutσá value≤á fo≥á thσ ì
- director∙ parameters¼ whicΦ arσ somewha⌠ likσ constants« The∙ d∩ no⌠ changσ ì
- a≤á ßá functioε oµ thσ pointed-t∩ file«á Finally¼á iεá ßá thirΣá step¼á thσ ì
- remaininτ parameter≤ arσ expanded« Fo≥ grou≡ macros¼ thi≤ fina∞ ste≡ iε thσ ì
- expansioε i≤ repeateΣ fo≥ eacΦ oµ thσ taggeΣ files« Thσ filσ parameter≤ arσ ì
- expandeΣá differentl∙ fo≥ eacΦ file¼á and¼á startinτ witΦ thσ seconΣá taggeΣ ì
- file¼ thσ "$!ó paramete≥ cause≤ "GOó substitution.
- :E
- ü Macr∩ Example≤
-
- Thσá macr∩ CM─ listinτ iε sectioε ü ╠ é show≤ aε examplσ oµ ßá ZFILER.CM─ ì
- file¼á onσá designeΣ t∩ illustratσ somσ technique≤ oµ macr∩ writing«á Whilσ ì
- writinτ thi≤ article¼ ╔ discovereΣ tha⌠ onσ caε includσ blanδ line≤ a≤ showε ì
- t∩ makσ thσ CM─ filσ easie≥ t∩ read« Thσ hel≡ screeε par⌠ oµ thσ listinτ i≤ ì
- takeε froφ m∙ persona∞ scrip⌠ filσ (oε which¼á ╔ havσ t∩ confess¼ ╔ havσ no⌠ ì
- reall∙ workeΣ ver∙ hard)« Thσ macr∩ definitioε par⌠ oµ thσ listinτ include≤ ì
- onl∙á ß fe≈ oµ thσ definitions«á Yo⌡ ma∙ wisΦ t∩ usσ thσ Prin⌠ functioεá oµ ì
- thσá HEL╨ utilit∙ t∩ prin⌠ ou⌠ thi≤ section¼á iε orde≥ t∩ follo≈ alonτá witΦ ì
- thi≤ discussion.
- Thσ macr∩ "Qó i≤ includeΣ t∩ illustratσ ß ver∙ simple¼ bu⌠ useful¼ typσ ì
- oµ macro«á I⌠ invoke≤ thσ ver∙ powerfu∞ filσ typinτ prograφ Q╠ (quicδ look⌐ ì
- oεá thσ pointed-t∩ file«á Thi≤ i≤ hand∙ wheε yo⌡ wan⌠ morσ powerfu∞ viewinτ ì
- capabilit∙á thaε tha⌠ offereΣ b∙ thσ built-iε "Vó command«á Q╠á caεá handlσ ì
- cruncheΣá file≤á anΣ libraries¼á anΣ i⌠ caε displa∙ tex⌠ o≥ he°á forwarΣá o≥ ì
- backward.
-
- Macr∩á "Uó uncompresse≤ ß file«á I⌠ illustrate≤ ß morσ comple°á scrip⌠ ì
- tha⌠ involve≤ flo≈ contro∞ anΣ parameter≤ tha⌠ extrac⌠ individua∞ component≤ ì
- oµá thσ pointed-t∩ filσ name«á I⌠ test≤ thσ filσ typσ t∩ seσ iµ thσá middlσ ì
- lette≥ i≤ "Qó o≥ "Z"«á Iε thσ forme≥ case¼á i⌠ unsqueeze≤ thσ file╗á iε thσ ì
- latter¼á i⌠á uncrunche≤á it«á Thσ uncompresseΣ filσ i⌠ pu⌠ int∩ thσá sourcσ ì
- file'≤ directory.
-
- Macro≤ S¼á K¼á anΣ ┬ illustratσ thσ usσ oµ inpu⌠ prompting«á Thσ firs⌠ ì
- onσ allow≤ thσ use≥ t∩ specif∙ thσ filσ attribute≤ t∩ bσ set« Notσ tha⌠ thσ ì
- promp⌠ include≤ ß helpfu∞ reminde≥ oµ thσ synta° requireΣ b∙ SFA.
- Macr∩á ╦á crunche≤á file≤ t∩ ßá user-specifieΣá destination«á I⌠á als∩ ì
- illustrate≤ ho≈ onσ log≤ int∩ thσ currentl∙ displayeΣ directory«á ╔ d∩ thi≤ ì
- herσ s∩ tha⌠ ß nul∞ answe≥ t∩ thσ promp⌠ (i.e.¼ jus⌠ ß carriagσ return⌐ wil∞ ì
- resul⌠á iεá thσá cruncheΣá file≤ beinτ placeΣá iεá thσá currentl∙á displayeΣ ì
- director∙ rathe≥ thaε iε thσ homσ directory¼á a≤ woulΣ otherwisσ bσ thσ casσ ì
- (sincσ tha⌠ i≤ wherσ thσ macr∩ run≤ from¼á remember)« A≤ ß result¼ however¼ ì
- thi≤á macr∩ wil∞ no⌠ operatσ properl∙ iε use≥ area≤ abovσ 1╡ unde≥á BGiΘá o≥ ì
- version≤á oµ thσ commanΣ processo≥ tha⌠ d∩ no⌠ allo≈ logginτ int∩ higΦá use≥ ì
- areas.
-
- Macr∩á ┬á perform≤á ßá slightl∙ morσ comple°á function«á I⌠á no⌠á onl∙ ì
- compresse≤ thσ pointed-t∩ filσ t∩ ß specifieΣ destinatioε directory¼á bu⌠ i⌠ ì
- theε mark≤ thσ sourcσ filσ a≤ havinτ beeε backeΣ up«á ┴ combinatioε oµá thσ ì
- grou≡á archivσá built-iε commanΣ (t∩ taτ file≤ tha⌠ neeΣ backinτ up⌐á anΣá ß ì
- grou≡ macr∩ ┬ (t∩ perforφ thσ backup⌐ give≤ thσ ZFILE╥ use≥ ß wa∙ t∩ bacδ u≡ ì
- file≤ iε cruncheΣ forφ oε thσ backu≡ disk.
- Macr∩á ═ i≤ includeΣ t∩ sho≈ tha⌠ ß ZFILE╥ macro¼á wheε i⌠ need≤ t∩á d∩ ì
- somethinτá morσ comple° thaε i⌠ i≤ capablσ oµ doinτ al∞ b∙ itself¼á caε pas≤ ì
- thσá tasδ t∩ aε ARUN┌ alias«á Thσ MOV┼ alia≤ firs⌠ determine≤á whethe≥á thσ ì
- sourcσá anΣ destinatioε arσ oε thσ samσ drive«á Iε tha⌠ case¼á MOVE.CO═á i≤ ì
- useΣá t∩á perforφ thσ move«á Otherwise¼á thσ sourcσ filσ i≤ copieΣá t∩á thσ ì
- destinatioε anΣ theε deleted«á Wha⌠ wσ have¼á therefore¼á i≤ ß MOV┼ commanΣ ì
- tha⌠ free≤ thσ use≥ oµ thσ responsibilit∙ oµ worryinτ abou⌠ whicΦ drive≤ arσ ì
- involveΣ -- anothe≥ examplσ oµ ho≈ Z-Systeφ caε freσ yo⌡ froφ consideration≤ ì
- tha⌠ neeΣ no⌠ concerε you¼ tha⌠ d∩ no⌠ requirσ humaε intelligencσ t∩ decide.
-
- Thσá fina∞ threσ macr∩ example≤ arσ executioε macros«á Macr∩ ╪á cause≤ ì
- thσá pointed-t∩á filσ t∩ bσ executed«á ┴ morσ sophisticateΣá versioεá migh⌠ ì
- checδá t∩ makσ surσ tha⌠ thσ filσ typσ i≤ COM«á ╔ opteΣ fo≥ thσ flexibilit∙ ì
- oµ pointing¼á fo≥ example¼á t∩ PROGRAM.Z8░ anΣ havinτ PROGRAM.CO═á run«á Iµ ì
- therσ i≤ n∩ CO═ filσ witΦ ß matchinτ name¼á thσ erro≥ handle≥ wil∞ takσ carσ ì
- oµ things«á Yo⌡ wil∞ notσ thσ leadinτ coloε beforσ thσ "$nó parameter«á I⌠ ì
- make≤á surσ tha⌠ thσ curren⌠ director∙ i≤ searcheΣ eveε iµ i⌠ i≤ no⌠ oεá thσ ì
- path« PrompteΣ inpu⌠ i≤ useΣ t∩ allo≈ ß commanΣ tai∞ t∩ bσ included.
- Thσá ┌ macr∩ perform≤ ß user-specifieΣ functioε oε thσ pointed-t∩ file« ì
- Tw∩á separatσ use≥ prompt≤ allo≈ botΦ thσ commanΣ anΣ ß commanΣ tai∞á t∩á bσ ì
- given«á Fo≥á example¼á iµ yo⌡ wanteΣ t∩ squeezσ thσ filσ t∩ A0:¼á yo⌡ woulΣ ì
- ente≥á "SQóá iε responsσ t∩ thσ firs⌠ promp⌠ anΣ "A0:ó iεá responsσá t∩á thσ ì
- second.
-
- Thσá ░ macr∩ illustrate≤ ho≈ thσ responsσ t∩ ß promp⌠ caε bσ useΣ a≤á ß ì
- ZFILE╥á script«á Thi≤ macr∩ take≤ carσ oµ al∞ thosσ function≤ wσ forgo⌠á t∩ ì
- includσ iε ZFILER.CMD« Thσ wholσ macr∩ i≤ jus⌠ prompteΣ input¼ anΣ whateve≥ ì
- wσ answe≥ wil∞ bσ ruε a≤ ß script«á ╔ usσ thi≤ functioε s∩ ofteε tha⌠ ╔ pu⌠ ì
- i⌠á oε ß numbe≥ ke∙ s∩ tha⌠ i⌠ caε bσ invokeΣ witΦ ß singlσ ke∙ rathe≥á thaε ì
- thσ usua∞ pair«á Also¼ a≤ yo⌡ ma∙ havσ noticed¼ ╔ includσ iε thσ macr∩ hel≡ ì
- screeε ß lis⌠ oµ thσ parameter≤ tha⌠ caε bσ used.
-
- Thσá onl∙á rea∞ limitatioε oµ thi≤ macro-to-write-a-macr∩á approacΦá i≤ ì
- tha⌠á prompteΣ inpu⌠ canno⌠ bσ includeΣ iε thσ response«á A≤ ╔ writσá this¼ ì
- however¼á i⌠á occur≤á t∩á mσá tha⌠á thi≤ limitatioεá coulΣá bσá overcomσá b∙ ì
- recursivel∙ parsinτ thσ promp⌠ parameter≤ unti∞ nonσ remain¼á anΣ onl∙á theε ì
- goinτ oε t∩ thσ subsequen⌠ macr∩ expansioε steps.
- :L
- ü SAMPLE MACRO LISTIN╟
- --------------------
- ╤ q∞ $p
-
- ╒ í iµ $t=?q?;$!sys:uµ $≡ $d$u:;else;$!sys:unc≥ $≡ $d$u:;fi
-
- ╙ í $!sfß $≡ $ó SF┴ Option≤ (/o,o.« o=ARC,-ARC,R/O,R/W,SYS,DIR)║ "
- ╦ í $d$u:;$!cruncΦ $µ $"Destinatioε director∙ (DU:⌐ -- ";$h:
- ┬ $d$u:;cruncΦ $µ $"Destinatioε director∙ (DU:⌐ -- ";sfß $µ /arc;$h:
-
- ═ í /movσ $≡ $"Destinatioε director∙ fo≥ move║ "
-
- ╪ í $d$u:;:$ε $ó CommanΣ Tail║ ";$h:
- ┌ í $d$u:;$ó CommanΣ t∩ perforφ oε file║ ó $µ $ó Tail║ ";$h:
- ░ í $"Ente≥ ZFILE╥ macr∩ script║ "
- ú SAMPL┼ ZFILE╥ MACRO╙ FO╥ TCJ
-
- 0« on-linσ macr∩ A« se⌠ Archivσ bi⌠ N« NULU
- 1« LPU╘ B« Backu≡ (cr/sfa⌐ O.
- 2« Z80AS═ t∩ CO═ C« CR├ P« Protect
- 3« Z80AS═ t∩ RE╠ D« Datσ displa∙ Q« QL
- 4« Comparσ File≤ E« Edi⌠ R.
- 5« F« S« SFA
- 6« G« T« Type
- 7« H« U« Uncompress
- 8« I« V« VLU
- 9« J« W.
- K« KruncΦ X« eXecute
- L« LDI╥ Y.
- M« Movσ Z« ruε command
-
- $íá ZE╪á 'GOº $─ DRIV┼ $╨á DU:FN.F╘ $╞ FN.FT
- $"..ó PROMP╘ $╒ USE╥ $╬ F╬ $╘ FT
- $'..º PROMP╘ $╚ HOME