Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filter clear
Message
From
18/10/2004 13:15:14
John White
Micro-Oriented Software Techniques, Inc.
Phoenix, Arizona, United States
 
 
To
17/10/2004 22:36:29
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00951906
Message ID:
00952342
Views:
10
Just to toss in a small point to make life "interesting". I've seen some discussion in this thread about making sure variables have values and that objects don't go out of scope, etc. Maybe something small like the following to avoid any possible issue?
lcOldFilter = set('filter')
lnOldRecno = Recno()
lcBillno = Thisform.sometextobject.value
ldDateIn = Thisform.somedateobject.value
lcDateIn = '{^' + tran(year(m.ldDatein)) + '-' + tran(month(m.ldDatein)) + '-' + tran(day(m.ldDatein)) + '}'
lcFilter = 'BillNo = [' +  m.lcBillno + '] and Datein = ' + m.lcDatein

set filter to &lcFilter
locate
if eof()
    =messagebox('Oops, no matching records', 16, 'Uh-oh, problem encountered')
    set filter to &lcOldFilter
    if between(lnOldRecno,1,Reccount())
        go lnOldRecno
    endif
endif
Since there are no variables nor objects of any type in the FILTER statement, nothing to be tripped up by.

>hi,
>thank you very much,
>it works
>
>lcFilter = "BILLNO=" + Transform( m.lcBillNo) + " AND DATEIN=CTOD('" + DTOC( m.lcDateIn) + "')"
>
>best regards
>m.qasem
John White [MOST]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform