Page 1 of 1

SET SCOPE sample

Posted: Sat Apr 08, 2006 9:13 pm
by Ehab Samir Aziz
I searched over all samples for the syntax for set scope and I could not find any .
Pls tell me How can I use SET SCOPE ? especially with variable conditions &(conditions) .
Thanks

Posted: Sun Apr 09, 2006 12:48 am
by Mike Buckler

Code: Select all

#IFDEF _setads
ordscope(0,(da1))
#else
set scopetop to (da1)
#endif

#IFDEF _setads
ordscope(1,(da2))
#else
set scopebottom to (da2)
#endif
This is how I do it
The file is indexed on date field.
ads uses 0 to scope top and 1 for scope bottom.
non ads uses 1 to scope top and 2 for scope bottom.

Posted: Sun Apr 09, 2006 3:52 pm
by Ehab Samir Aziz
where can I put my condition eg. date > 31/12/2006

ordscope

Posted: Sun Apr 09, 2006 6:13 pm
by Arvisnet
Sample:
index: tienda + Dtos(fecha)

my var's"
ctienda
dFecha

from tienda x , fecha y
To tienda n , fecha z

DbSelectArea("VentaSuc") ; VentaSuc->(ORDSETFOCUS("TIENDAFEC")) ; VentaSuc->(DbGotop())
VentaSuc->(OrdScope(0, ctienda+ Dtos(dFecha ) ) )
VentaSuc->(OrdScope(1, ctienda + Dtos(dFecha ) ) ) ; VentaSuc->(DbGotop())

format:

ORDSCOPE(0,yourFirstRecord) //topscope
ORDSCOPE(1,yourEndRecord) //bottomscope
yourDBf->(DbGotop())

Posted: Sun Apr 09, 2006 6:50 pm
by Ehab Samir Aziz
I am sorry some English is better than some Spanish I am Very Sorry I can not understand this . Also I have multiple variable conditions . May I have to index my DBF according the multiple variable conditions .

filter =="upper(Name)="EHAB" .AND. age < 30
.and. (4->me_date) > (dtos date_from) .and. ;
(4->me_date) < dtos(date_to) "

..
set filter to &(filter)
..
etc