Further to all the other good advice, just a note on your conventions. Always select the next highest work area, rather than a numbered or lettered area, i.e. not:
Select a
Use iGroup
but:
Select 0
Use iGroup
or shorter:
Use iGroup in 0
You can lose track of what areas you have used. Somewhere in a large system you're likely to accidentally select the same letter or number to open another table, thus releasing the table you already have open in that area.
Select 0 will always ensure you have a new, unused area.
The code:
>sele b
>use pcode1
>set order to pcode
could be replaced by:
Use pCode1 in 0 Order pCode
Terry
>mydate=ctod("01/01/2006")
>mydate1=ctod("28/02/2006")
>myigroup='BLUE '
>sele a
>use igroup
>set order to igroup
>sele b
>use pcode1
>set order to pcode
>set rela to igroup into igroup addi
>sele c
>use selsal
>inde on billno for sels='Y' to selbill
>IGCOND="PCODE1.IGROUP=MYIGROUP"
>
>use sales1
>set order to billdate
>set rela to billno into selsal addi
>set rela to pcode into pcode1 addi
>seek mydate
>copy to tsales1 for found("selsal") and &IGCOND WHILE BILLDATE<=MYDATE1
>SELE F
>USE TSALES1
>
>
>WARM REGARDS,
>MK.
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.