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

Re: Carl's notes



Reply to note from Carl Distefano  Sun, 31 Aug 2008
13:18:39 -0400

The logic of frame VA@* is a little difficult to follow, because the
code is generalized to accept input from any Save/Get (except 50-
55). So, here's a revised version of the commented code I posted
yesterday, which includes the refinements/corrections that I've
since incorporated into frame VA@*:

XPLeNCODE v2.0
b-gin [UNTITLED]
;*; "VA@*nn,x"-style operator (overcomes 77-byte limit of nat
ive VA@nn,x)[cr|lf];*; Commented demo code (CLD rev.8/31/08)[
cr|lf];*;[cr|lf];*; Data:[cr|lf]{<}SV01,segment1,segment2,seg
ment3,segment4,segment5,segment6,segment7,segment8,segment9,s
egment10,segment11,segment12,segment13,segment14,segment15,se
gment16,segment17,segment18,segment19,segment20,segment21,seg
ment22,segment23,segment24,segment25,segment26,segment27,segm
ent28,segment29,segment30,segment31,segment32,segment33,segme
nt34,segment35,segment36,segment37,segment38,segment39,segmen
t40,segment41,segment42,segment43,segment44,segment45,segment
46,segment47,segment48,segment49,segment50{>};*;[cr|lf];*;[cr
|lf]{<}SV02,,{>};*; Separator = "," (e.g.)[cr|lf]{<}SV03,43{>
};*; Desired segment = 43 (e.g.)[cr|lf]{<}SV04,{>};*; Content
s of desired segment (on EXit)[cr|lf]{<}SV05,{>};*; XS parse{032}
placeholder for right-side string ("Right$")[cr|lf]{<}SX06,{<
}IS01{>}{>};*; Working copy of data S/G 01[cr|lf]{<}SX07,0{>}
;*; Counter[cr|lf];*;[cr|lf]{<}CUb,03{>};*; Parsing loop (Cou
ntUp):[cr|lf]{<}SX07,{<}PV07{>}+1{>};*; Increment counter[cr|
lf]{<}XS06,02,04,,05{>}{<}SX06,{<}IS05{>}{>};*; Parse around{032}
separator[cr|lf];*;[cr|lf];*; Leave loop early if:[cr|lf];*;{032}
 (1) only one segment is left in Right$ on the next-to-last p
ass[cr|lf];*;   (i.e., we've found the desired segment--no
 further parsing is[cr|lf];*;    necessary); or[cr|lf];*;{032}
 (2) counter exceeds number of segments in data[cr|lf];*;  {032}
 (i.e., desired segment does not exist)[cr|lf]{<}IF({<}PV07{
{062}}=={<}PV03{>}-1&{<}IS02{>}{238}{<}IS05{>}<0)!({<}PV07{>}>{<}
PV03{>}&{<}VA|05{>}<1){>};*;[cr|lf];*; Poke Right$ into 04, t
hen display result and EXit[cr|lf]{<}SX04,{<}IS05{>}{>};*;[cr
|lf]{<}LBa{>}{<}PR@04{>}{<}EX{>}{<}EI{>};*;[cr|lf];*;[cr|lf];
*; CountUp boundary (at LaBel "b", loop back to "")[c
r|lf]{<}SV05,{>}{<}LBb{>};*; Zero out Right$ placeholder for{032}
next{032}
pass[cr|lf];*;[cr|lf]{<}GLa{>};*; Prove it (execute PRompt at
 LaBel "a", then EXit)[cr|lf]
-nd
XPLeNCODE

--
Carl Distefano
cld@xxxxxxxx