FINDRX type

A variable of FINDRX type can be used with findrx. Definition:

 

type FINDRX ifrom ito fcallout paramc

 

ifrom - start from here. 0-based character index in string.

ito - until here. If 0, until string length.

fcallout - callout callback function.

paramc - some value to pass to the callout callback function.

 

Before passing the variable to the function, you can set some its members, and leave unused members uninitialized, that is 0. For example, if you don't need a callout, you can set only ifrom and/or ito.

 

Example

str s="One two three"
str rx="[a-z]+(?C)o"
FINDRX r
r.fcallout=&sub.CalloutCallbackFunction
int i=findrx(s rx r)

#sub CalloutCallbackFunction
function[c]# CALLOUT*p
out p.start_match