At 05:31 PM 7/15/2008, Lawrence Lustig wrote:
I'm trying out the PROPERTY command to search a table for the next
matching record.
My code is:
-- PAUSE 2 USING .fCM_SelCustNum
SET VAR fTemp_CustNum = (CTXT(.fCM_SelCustNum))
PROPERTY TABLE 'Customer->SEARCH->CustNum->' .fTemp_CustNum
RETURN
If I uncomment the PAUSE statement I see that fCM_SelCustNum does
hold a correct customer number.
Does anyone have this function working? The column CustNum in type
INT, is that allowed in SEARCH->?
It is NOT a problem as quoted in your subject line.
Remember, we are only limited by our knowledge and experience of
the product and/or knowing details of any functionality in R:BASE.
Here's the correct approach to design a dynamic search.
-- A very simple example based on a Customer table in RRBYW14 sample database
-- Assuming you have defined the vColumnName and vSearchValue
-- Start here
CLEAR VARIABLE vSearchString,vQuotes
SET VAR vSearchString TEXT = NULL
SET VAR vQuotes = (CVAL('QUOTES'))
SET VAR vSearchString = +
('PROPERTY TABLE
Customer'&.vQuotes+'SEARCH->'+.vColumnName+'->'+.vSearchValue+.vQuotes)
&vSearchString
CLEAR VARIABLE vSearchString,vQuotes
RETURN
-- End here
That's all there is to it!
More samples to design dynamic search forms using DB Grid are also included
with 2008 SAT Sample Applications: http://www.rupdates.com/sat2008/
Very Best R:egards,
Razzak.