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

Re: RE $SS usable in XPL?



** Reply to message from "Patricia M. Godfrey"
 on Sun, 22 Jul 2007 15:06:23 -0400


> I'm probably getting in over my head, but...
> Is it possible to use the ?SS call (found in Xy4.dlg frame
> AppSty) to get a list of all the styles (when you don't know
> how many there are and don't want to bother counting them)
> currently defined for a file? And save that set of strings,
> concatenated with commas, to a SV, so that one could then do
> a substring search to see if one had a style of a certain
> name Saved? (I nearly always use the same names for styles.)

Sure, it's possible -- not directly (there's no native command
to do this), but U2 has a frame (actually several frames) that
grabs this info for U2's internal use. You too (U2) can
intercept that info and do whatever you want with it. The
primary tool is frame SPCLLST -- see HELP SPCLLST,
which displays all of the two-character arguments that are
available -- representing all of XyWrite's internal macros --
and offers a usage example. The basic idea would be, in your
situation:
 JM 2.SpclLstQ2 
That would display on the PRompt line all of the StyleSheets
embedded in your current document. Pretty elementary. SPCLLST
separates them with carriage returns, so if you really must have
comma separators, then you need to do something like:
 JM 2.SpclLstQ2 {240_a.k.a._"contains"}>+","+>
That would display on the PRompt line a comma-separated list of
your Styles. But I don't really see why you need to make a list
and then search it, if the Styles are plainly displayed on the
PRline, and all you require is on-the-fly information ... unless
you've defined so many Styles that they won't all fit on the
line. The first, simple little program, above, ought to suffice
in most situations.

OTOH, if you're looking for
> a style of a certain name
i.e. you just want to know whether or not you've already
established a particular Style by name, then you could add to U2
a personal frame such as the one below. All three ideas are
XPLeNCODEd here (Copy, Paste into empty XyWrite window, put
cursor at beginning of screen, DECODE). The smart
thing to do would be to pick the approach you like, reshape it
as a frame, and add it to U2:

XPLeNCODE v2.0
b-gin [UNTITLED]
{<}SV50,SS{>}[JM_]2.SpclLst[Q2_]{<}PR@50{>}{<}EX{>}[cr|lf][cr
|lf]{<}SV50,SS{>}[JM_]2.SpclLst[Q2_]{<}SV01,[cr|lf]{>}{<}LBA{
{062}}{<}IF{<}IS50{>}{240}{<}IS01{>}{>}{<}XS50,01,02,,03{>}{<}SX5
0,{<}IS02{>}+","+{<}IS03{>}{>}{<}GLA{>}{<}EI{>}{<}PR@50{>}{<}
EX{>}[cr|lf][cr|lf]{{;5Style}} Is a StyleSheet is embedded in
 current doc? RJH 7/23/07[cr|lf]{002}{<}IF{<}VA|50{>}<1{>}{<
}PRSyntax: STYLE stylename{>}{<}EX{>}{<}EI{>}{<}SV07
,[cr|lf]{>}{<}SX08,{<}IS07{>}+@UPR({<}IS50{>})+{<}IS07{>}{>}{
<}SV50,SS{>}[JM_]2.SpclLst[Q2_]{<}SX50,{<}IS07{>}+@UPR({<}IS5
0{>}){>}{<}SV07,No{>}{<}IF{<}IS50{>}{240}{<}IS08{>}{>}{<}SV07
,Yes{>}{<}EI{>}{<}PR@07{>}{002}[cr|lf][cr|lf]
-nd
XPLeNCODE

-----------------------------
Robert Holmgren
holmgren@xxxxxxxx
-----------------------------