[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: Carl's notes
- Subject: Re: Carl's notes
- From: Carl Distefano cld@xxxxxxxx
- Date: Sat, 30 Aug 2008 22:21:04 -0400
Reply to note from Harry Binswanger Sat, 30 Aug
2008 18:08:27 -0400
> Damn! Wouldn't you know it: my most elegant use of VA@ comes
> when I run it on a file that can have strings up to about 150
> bytes. Now I'm going to have to try Carl's parser on it.
Here, this simplifies it. DECODE the frame below (DECODE),
DeFine the entire block of code, and add it to U2 (ADD2U2).
It's a replacement for that overcomes the 77-byte
limitation of native VA@. Instead of, say, , you do
JM 2.VA@01,3Q2 (where JM and Q2 are real functions, of course).
Output is written to Save/Get 50. In other words "JM 2.VA@01,3Q2 "
is the equivalent of ">". You can then use S/G 50 or
hand the contents of S/G 50 off to any S/G you want. Just avoid
using S/Gs 51-54 in any program that calls this frame.
XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5VA@*}} "VAnn@,x"-style parsing operator (e.g., [JM_]2.VA@
01,35[Q2_]) overcomes 77-byte limit of native VA@nn [S/G 50 o
ut] CLD 8/30/08[cr|lf]{002}{<}SX51,{<}VA$FR{>}{>}{<}SX51,{<}
VA@51@02{>}{>}{<}SV52,{027}S{>}{<}XS51,52,52,53,54{>}{<}SX50,
"{<}IF{<}VA|"+{<}IS52{>}+"{>}<0{>}{<}SV"+{<}IS52{>}+",{>}{<}E
I{>}{<}SX51,{<}IS"+{<}IS52{>}+"{>}{>}"{>}{<}PV50{>}{<}SV52,{>
}{<}SX55,0{>}{<}CUa,54{>}{<}SX55,{<}PV55{>}+1{>}{<}XS51,53,50
,,52{>}{<}IF{<}VA|52{>}<1&{<}PV55{>}<{<}PV54{>}{>}{<}SV50,{>}
{<}LBb{>}{<}SV51,{>}{<}SV52,{>}{<}SV53,{>}{<}SV54,{>}{<}SV55,
{>}{<}EX{>}{<}EI{>}{<}SX51,{<}IS52{>}{>}{<}LBa{>}{<}GLb{>}{00
2}[cr|lf]
-nd
XPLeNCODE
This frame fixes a bug in the code I posted earlier today. The
earlier code returns a false value if the specified segment number
is greater than the actual number of segments in the data. In that
case, the operation should return a zero-length string; the earlier
code erroneously returned the contents of the last data segment.
--
Carl Distefano
cld@xxxxxxxx