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

Re: U2 frame



The following is a real world example of my use (using "real world" loosely).

It's for my XyBasic. I have a feature that emulates a database by getting a "field" from a "record". The syntax I decided to have for the user is:

get [varying name of field]$ from [varying name of record-string]$ [ascii 22] [varying _expression_]

Ascii 22 is used as the field separator, but to simplify the examples below, I'll use a slash for the separator.

get author$ from postdata$ / column$  <=== column$ evaluates to the number of the field--e.g., 3
get subject$ from postdata$ / 2  <=== here the "_expression_" for the field or column is a literal number

Each "get" line has to begin with and end with a [crlf]. The string for the record (postdata$, here) has to be stored in s/g 50 so that the XyBasic, user-friendly, source will translate into this XPL

>
>

To make it work, I had to do the kind of swapping we're talking about.That was necessary only because I wanted the user to be able to enter variables in a common-sense order (get A from B).

Esoteric enough for you?

Thanks for the updated routine. I will install it forthwith.


On Sun, Sep 11, 2011 at 1:19 PM, Carl Distefano mailto:cld@xxxxxxxx wrote:

Reply to note from Harry Binswanger mailto:hb@xxxxxxxx Sun, 11 Sep
2011 11:02:30 -0400

> Terrific! Just what I wanted. I took out the prompting ...

I was about to add an option to do that, but it was the wee hours
and I petered out. Here it is; use framename SWI (think "SwapWild
Invisible") to bypass the PRompts. This code includes some
additional (minor) corrections and refinements.

Always happy to oblige if I can, Harry, but I must say this all
seems a bit esoteric. Can you give one or two real-world examples of
how you would use this routine?

XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5swapwild,swi}} Swap wild substrings within target string{032}
[CLD rev.9/11/11-a][cr|lf]{002}{<}IF{<}VA$WS{>}==1{>}{<}IF{<}
VA|50{>}>0{>}[BX_]es 1[Q2_][DX_][TF_][255+048+068][CL_]{<}SU0
1,{<}SX50,{<}CP{>}-2{>}[TF_][RC_][JM_]2.ReJuMP[Q2_]{>}{<}SV02
,[wW]{>}{<}SX03,0{>}{<}SV04,{>}{<}XS50,02,05,,04{>}{<}SV06,{>
}{<}XS04,02,07,,06{>}{<}IF{<}VA|05{>}>0&{<}VA|06{>}>0{>}{<}LB
a{>}[BX_]se/f {252}{<}PV50{>}{252}[Q2_]{<}IF@not({<}ER{>}){>}
[YD_][DF_][BX_]se {252}{<}PV50{>}{252}[Q2_][DF_]{<}SV08{>}{<}
SV09,{>}{<}XS08,05,04,10,09{>}{<}SV11,{>}{<}XS09,07,12,,11{>}
{<}SV13,{>}{<}XS11,06,14,,13{>}{<}SX15,{<}IS05{>}+{<}IS14{>}+
{<}IS07{>}+{<}IS12{>}+{<}IS13{>}+{<}IS06{>}{>}[DO_]{<}IF@upr(
{<}VA$FR{>})=="SWI"{>}{<}LBb{>}[DN_]{<}GT15{>}[DX_]{<}SX03,{<
}PV03{>}+1{>}[YD_]{<}GLa{>}{<}EI{>}{<}SX08,"Change to """+{<}
IS15{>}+""" (y|N)?{>}{<}PR@08{>}{<}SX08,@upr({<}RK{>}){>}{<}I
F{<}VA$KC{>}<2{>}[YD_]{<}GT01{>}{<}PRQuit{>}{<}EX{>}{<}EI{>}{
<}IF{<}IS08{>}=="Y"{>}{<}GLb{>}{<}EI{>}{<}GLa{>}{<}EI{>}[TF_]
[RC_]{<}SX02,{<}IS03{>}+" changes{>}{<}PR@02{>}{<}EX{>}{<}EI{
{062}}{<}GT01{>}{<}EI{>}{<}PRSWAPWILD|SWI substring1[wild_W]subst
ring2[wild_W]substring3{>}{<}EX{>}{<}EI{>}{<}PRNo fi
le{>}{002}[cr|lf][cr|lf]
-nd
XPLeNCODE

--
Carl Distefano
mailto:cld@xxxxxxxx