Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get records
Message
De
29/08/2004 16:51:28
 
 
À
29/08/2004 15:30:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00937427
Message ID:
00937436
Vues:
10
Hi Mohammed,

I don't quite understand what you are trying to do, but one obvious source for error is that you have a memory variable with the same name as a field, which I strongly recomment that you avoid. And please format your code by indenting and unindenting. It makes the code so much easier to read, and also it makes errors, like not matching IFs and ENDIFs, easier to discover. I formatted yor code to show you how I prefer to see it:
SELECT 1
USE aliq
m.no=no
m.nam=nam
DO WHILE .t. and no=m.no 
  skip
  IF m.no<>no 
    m.no=no

    IF EOF()
      EXIT
    ENDIF
  endif
enddo
Try this, I simplified your code and changed the memory variable name, except for that it should do exactly the same:
SELECT 0 && Always select 0 to let VFP find a free work area!!! Or SELECT an alias by name
USE aliq
m.lno=no
SCAN FOR no=lno
   IF lno#no
      lno=no && this line will throw you out of your loop, but is that what you want to do?
   ENDIF
ENDSCAN
To get the code easier to read at UT, you can add "< pre >" before your code, and and "< /pre> " after. Remove the spaces, I must enter them here or UT will translate my formatting code.

>hi all,
>any idea.
>my table has field (flag) i insert 1,2...3 you can see 10 records have flage 1,20 records has flage 2 etc....
>i need to get 5 records from evry flag to insert to anther table hase the same filds.
>
>i'll try with code but the gode get all records
>
>SELECT 1
>USE aliq
>m.no=no
>m.nam=nam
>DO WHILE .t. and no=m.no
>skip
>
>IF m.no<>no
> m.no=no
>
>IF EOF()
>EXIT
>ENDIF
>endif
>enddo
>
>
>thanks
>m.qasem
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform