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
SET SCOPE sample
-
- Posts: 67
- Joined: Thu Jan 05, 2006 10:35 pm
- Location: Canada
- Contact:
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
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.
-
- Posts: 334
- Joined: Fri Oct 14, 2005 1:54 pm
ordscope
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())
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())
-
- Posts: 334
- Joined: Fri Oct 14, 2005 1:54 pm
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
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