Browse thread
Re: Text.get/Text.search in labltk
- David Thomas
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | David Thomas <david_hd@y...> |
| Subject: | Re: Text.get/Text.search in labltk |
Ah, I found the problem. `Atxy is looking for display coordinates, rather than (line, char). --- David Thomas <david_hd@yahoo.com> wrote: > Whoops. > > The l+1 was an earlier experiment that hadn't been > removed. It works the same whether it is there or > not. > > > > The code: > > let rec printwords () = > > match Text.search > > ~switches:[`Regexp] > > ~pattern:"[a-zA-Z]" > > ~start:(`Atxy (0, 0), [`Wordend; > > `Char > > 1]) > > text > > with `Linechar (l, c) -> > > Printf.printf "(%d, %d) -> %s\n%!" > > l c > > (Text.get > > ~start:(`Atxy > (l+1, > > c), []) > > ~stop:(`Atxy (l, > c), > > [`Lineend]) > > text > > );; > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam > protection around > http://mail.yahoo.com > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com