Locator without Window Control

Hello everybody!

I have a question. There is a way do a locator without any Window Controller in a procedure?

I want to search in a data file records in a data file and return the results based on a parameter (string parameter). For example. want to search for the word cardboard, and only write the work card and in the return get all the records that contains the letters card.

Any suggestion will be appreciated.

Cheers @ Urayoan

What file driver are you using?

Hi Brahn. I an using Pervasive Btrieve driver

ok, so that supports sql syntax yeah?

Taking directly from the Clarion help on SQL()

PrimaryKey  KEY(Ord:OrdID),PRIMARY
Record      RECORD
OrdID        LONG
Customer     LONG
PurchaseDate DATE
Info         CSTRING(61)

MyView  VIEW(AFile), FILTER('Ord:PurchaseDate = TODAY() AND ' & |
      'SQL(A.Info LIKE "%Must deliver today%")'), ORDER('SQL(A.Customer)')

MyView{PROP:Filter} = 
 'SQL(A.Customer IN (SELECT CustID FROM Customers WHERE BadCustomer = 0))'

!ABC template generated code: SQL(ProductID > 5) entered on Record Filter line
BRW1.SetFilter('(SQL(ProductID > 5))')

!For the Clarion template chain, the generated code is:
BRW1::View:Browse{Prop:Filter} = 'SQL(ProductID > 5)'

Notice the 'SQL(A.Info LIKE "%Must deliver today%")' bit?

At least that’s the idea I think. I assume that LIKE works for pervasive too?
If you get stuck, post an example of where you get to and we can see

Thanks @brahn. The situation is, Pervasive have two modes to work, PSQL and Btrieve. The Btrieve mode does not accept SQL syntax as far as i know (that would be a nice experiment indeed) and as you guessed, we use Btrieve :smile:

Ah, I see. Well you can still use PROP:Filter but probably a lot less efficient and you are back to looping.
Maaaybe you will have some success with Match() but again, that will come back to the file driver support most likely.

Beyond that I think you might need to experiment while you wait and see if someone with Btrieve experience jumps in :slight_smile:

1 Like