[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Xy4 routine to format XYENCode output



I know I said I'd hold off on posting more U2 code, but that was
just before I plateau'd with this routine. So....

Here's a corrected and substantially improved QDF4.PM -- now recast
as a U2 frame and renamed to FMT. What this frame does is to take
raw XYENCode output and turn it into a formatted, structured
listing, with indented IF statements, BOldface functions, and color
added to LaBel, GoLabel and EXit commands. Most coded characters,
e.g. {tilde}B for Ascii-2, {tilde}252 for Ascii-252, etc. etc.,
are translated into the corresponding 3-byte characters, so that the
listing, when displayed in draft view, closely resembles the
original XPL code in eXPanded view -- but with the visual
enhancements noted above.

The block of code below includes the new frame FMT, and the latest
iteration of frame XYENC*,XYDEC. Decode it, DeFine the result in its
entirety, and issue ADD2U2 to add it to U2. You need to
have Wally's XYENCode and XYDECode utilities in Editor's directory.

To get a hands-on feel for what this is about, try the following.
CAll one of your XPL programs. Issue XYENC. The result is
what I refer to above as "raw" XYENCode. Issue XYDEC to
toggle back to the original XPL. Issue XYENC again. Now,
issue FMT to generate a formatted listing. Finally, issue
XYDEC against the formatted listing to return to the XPL
original. Do you see what is so nifty about Wally's programs? Both
the raw encoding and the formatted encoding decode (instantaneously,
flawlessly) back to the original XPL.

To learn how and why this works, read Wally's documentation
(XYENCDEC.TXT).

'%--_XYENCode_start--
{{5xyenc*,xydec}}_XYENCode|XYDECode_(DF_block_or_entire_file
)_[CLD_rev.1/21/09]'^~B~==1~>'BXes_1'Q2'DX~~)~>~~~="/"
~>~~~>~~'DZ~<1~>'YD~~~~="DEC"~>'XP'LB'BXse__~start--'Q2~
)~>'LB~~'-'-end--'Q2~>~
~~'DF~'DF~~~>'JM2.Get
Path'Q2~+"\"+~+"."~>'DE'BXsad/nv_~in'Q2~~>~~~
'BXwt'Q2'DN'BXernv_~out'Q2'BXwt'Q2'BXdos/nv/x/z_/c_~<
PV06~>com_._~out<~in'Q2'BXwt'Q2~~'BXexist_~out'Q2~)~>~~'BX
p'Q2~'GT'DO'FF'DX~~="ENC"&~<1~>~+"start--'^'^"+~+"'-'-end--'^"~>~~<
SV03,~>'LU'LU~~~>'BXme_~out'Q2'BXwt'Q2
'BXernv_~out'Q2'BXwt'Q2~)~="ENC"~>~~>0&~<>8~>'TG~~~~>'BXseba__'?Z'Q2~)&~==~
-2~>'RC'RC~~~~~>'JM2.ReJuMP'Q2
'DO'FF~~~~~B'^'^{{5fmt}}_Form
at_XYENCoded_XPL_[CLD_rev.1/21/09]'^~B'BXes_1'Q2'XP'TF'BXcia
__'?<_:~<'Q2'BXcia__'?>_:~>'Q2',*','^~~~~~~~
~~~~~~~~~~>~~3DI,~3DI'Q2'CR~>',*','^~~'BXse__
:~'Q2~~>~~',*','^'DF
'CL'DF~'YD'BXseb__:~'Q2',*','^~)=="F"~>~~~',*','^'BXse__:~>
'Q2~~'CL~'^~'TF',*','^'BXci__;~[
'Q2'BXwt'Q2',*','^'BXci_~252:~'BXci_~252;~[;~[:~)~>'BXwt'Q2~~',*','^'BXci_~252:~~252
;~[:~~252'Q2'BXwt'Q2',*','^~'BXci_~252;~[;~[:~~252;~[:~~252'Q2~)~>'BXwt'Q2~~<
EI~>',*','^'BXci_~252:~~252:~;~[~252'Q2'BXwt'Q2',
*','^'BXci_~252:~;~[;~[~252:~;~[~252'Q2'BXwt'Q2',
*','^~'BXci__;~[;~[;~)~>
'BXwt'Q2~~',*','^'BXcia_~252;NDI;~>;~[~252;NDI;~>
~252'Q2',*','^'BXci_~252'`;A;X~252;~'`;A;X_;~
~252'Q2'BXwt'Q2',*','^'BXci_~252:~~252;~:~;~~252'Q2'BXwt'Q2',*','^'BXci_~252:~~252
;~:~;~~252'Q2'BXwt'Q2',*','^'BXci_~252
:~~252;~:~;~~252'Q2'BXwt'Q2',
*','^'BXci_~252:~~252;~:~;~~252'Q2
'BXwt'Q2',*','^'BXci_~252:~~252;~:~;~<
MDNM;~>~252'Q2'BXwt'Q2',*','^'BXci_~252;~[:~>;~~252:
~>;~;~[~252'Q2'BXwt'Q2',*','^'BXcia__'`^_'`^;~['Q2'BX
wt'Q2',*','^~'BXcia__'`^;~[;~[_'`^;~['Q2~
)~>'BXwt'Q2~~',*','^'BXci_~252:~'BXci_~252;~[;~[:~)~>~~'BXwt'Q2',*','^'BXc
i_~252;~:~:~:~:~;~~252:~;~;~[~252'Q2'BXwt'Q2',*','^'BXci__;~[,_,'Q2'BXwt'Q2
',*','^'BXci_~252;~'`BX~252;~[;~'`BX~252'Q2'BX
wt'Q2',*','^'BXci_~252;~[;~[;~'`BX~252;~[;~'`
BX~252'Q2'BXwt'Q2',*','^'BXci_~252'`Q2_;~~252'`Q2_;~<
MDNM;~>;~[~252'Q2'BXwt'Q2',*','^'BXci_~252'`Q2_;~;~[
;~[~252'`Q2_;~;~[~252'Q2'BXwt'Q2',*','^'BXci_~252;~<
MDNM;~>;~[;~[~252;~;~[~252'Q2'BXwt'Q2',*','^'BXci_~252
'`Q2_;~;~['`,*'`,'`^;~[~252'`Q2_;~'`,*'`,'`^
;~[~252'Q2'BXwt'Q2',*','^~/'?176):~176/'?1
77):~177/'?178):~178/'?179):~179/'?180):~180/'?181):~181/'?1
82):~182/'?183):~183/'?184):~184/'?185):~185/'?186):~186/'?1
87):~187/'?188):~188/'?189):~189/'?190):~190/'?191):~191/'?1
92):~192/'?193):~193/'?194):~194/'?195):~195/'?196):~196/'?1
97):~197/'?198):~198/'?199):~199/'?200):~200/'?201):~201/'?2
02):~202/'?203):~203/'?204):~204/'?205):~205/'?206):~206/'?2
07):~207/'?208):~208/'?209):~209/'?210):~210/'?211):~211/'?2
12):~212/'?213):~213/'?214):~214/'?215):~215/'?216):~216/'?2
17):~217/'?218):~218/'?219):~219/'?220):~220/'?221):~221/'?2
22):~222/'?223):~223/'?224):~224/'?225):~225/'?226):~226/'?2
27):~227/'?228):~228/'?229):~229/'?230):~230/'?231):~231/'?2
32):~232/'?233):~233/'?234):~234/'?235):~235/'?236):~236/'?2
37):~237/'?{):~{/'?239):~239/'?=):~=/'?241):~241/'?242):~242
/'?243):~243/'?244):~244/'?245):~245/'?246):~246/'?247):~247
/'?248):~248/'?249):~249/'?250):~250/'?251):~251/'?252):~252
/~>~',*','^~~>0~>~~~~>',*','^'BXcha_)~)'Q2'BX
wt'Q2~~',*','^'WG~<9~>'MK~'DO'FF
~~B'^'^
'%--_XYENCode___end--

--
Carl Distefano
cld@xxxxxxxx