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

Re: Harry's Basic Program



** Reply to message from "Morris Krok"  on Sun, 28 Dec
2003 10:07:50 +0200

Morris:

I sure wish you asked questions more clearly. Often I don't know what you're
talking about.

> There is one other thing which I cannot see whether it is possible to do. When
> one is in the www. serve.com/xywwweb/xysearch.cgi website, to have a program,
> that will call up every item with say the name Carl, or Robert and then save
> the entire collection in a specific file.

"To have a program that will call up every item with the name Carl or
Robert..." Are you asking how to construct a query? Are you looking in
XySearch for a reference to a program that somebody may, or may not, have
written that does this? Call up every "item" where? To have a program...?
The query engine IS a program!

> At present there are 12 squares

12 "squares"? Where? I don't see any squares.

> and one has to click sequentially on them to
> extract all the information, after ,of course ,entering what you have searched
> for.

This is totally unintelligible to me, Morris. I have no clue what you're
talking about. If you're saying that your query returned 12 possible messages,
and you have to look at each one to see if it has useful information, well, yes
-- that's the nature of search engines. You have to frame your query more
narrowly, to find the information you want.

You also want to "capitalize the first letter of a word". Of _a_ word, or
every word? If you want to capitalize _a_ word programatically, you locate
your cursor on it and use the native command CU.

If you want to construct a program to capitalize the first letter of _every_
word in an entire text, then that's very easy to accomplish. You're pretty
savvy about XPL, and I think you could do it yourself if you struggled with it.
Let's look at one implementation:

First, release any existing DeFine state and eXPand the text so that every word
displays:
 YD XD XP
Create an exclusion list, and CAPITALIZE it -- I'll use your provisional list
(obviously you need to add more words to it):
 
Note that I save the exclusion list to Save/Get 51 because an upcoming routine
(STRIPS) uses Save/Gets 01 through 03, and I don't want to conflict with them.
Now LaBel the beginning of a processing loop (my intent is that processing will
begin at the current cursor position, and run to End_Of_File):
 
Define the next Word and jump the cursor to the Beginning (first letter) of the
Defined $tring:
 DW DB
SaVe the DefinedWord to Save/Get 50, then release or eXit Define:
  XD
Now run the saved word through a filter to strip off punctuation that may have
been picked up by func DW -- the routine that does this (STRIPS) is in U2:
 JM 2.stripsQ2
STRIPS takes Save/Get 50 as an input $tring, and spits S/G 50 back out,
stripped of any punctuation fore or aft. Now we check whether or not the
stripped $tring (UPPERCASED for purposes of comparison) is contained in your
exclusion list:
 )+"|"){238}<0>
If this word is NOT part of the exclusion list, we UPPERCASE the first letter,
and then End the conditional (EndIf):
 BX uc XC 
Now we move to the NextWord:
 NW
Check whether we've reached the end of the file yet:
 <1>
If not, loop around and process again:
 
Otherwise, we're Done:
 

Pretty simple stuff. Here's the code. Let me know if there's anything you
don't understand.

XPLeNCODE v2.0
b-gin [UNTITLED]
[YD_][XD_][XP_]{<}SV51,|AND|AS|TO|THE|A|FROM|WAS|{>}
{<}LBA{>}[DW_][DB_]{<}SV50{>}[XD_][JM_]2.strips[Q2_]{<}IF("|
"+@UPR({<}IS50{>})+"|"){238}{<}IS51{>}<0{>}[BX_]uc[Q2_]{<}EI{
>}[NW_]{<}IF{<}VA$FE{>}<1{>}{<}GLA{>}{<}EI{>}{<}PRDone{>}{<}E
X{>}
-nd
XPLeNCODE

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