Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to separate an variable
Message
De
20/11/2017 11:06:29
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
20/11/2017 08:24:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Divers
Thread ID:
01655668
Message ID:
01655717
Vues:
62
>>This way can also be Done.
>>
>>
>>partno = 'abc defg hijkl LMN OPQ diw -0o32ewk dkdm woewmlmdlsm'
>>L=LEN(partno)
>>nLasposition=1
>>FOR I=1 TO L
>>cSpace=SUBSTR(Partno,I,1)
>>IF cSpace=" "
>>nSpaceposition=I
>>cPart=SUBSTR(Partno,nLasposition,I-nLasposition)
>>nLasposition=I+1
>>WAIT WINDOW cPart
>>ENDIF
>>Endfor
>>
>
>
>Yes, it can, but ALINES() is faster and the code is more readable and more likely to be correct the first time.
>
>Tamar

I keep seeing these kinds of things. It's like the count the number of weekdays between 2 dates. If you use a loop to do it, your thought process is no better than that of an 8 year old child. If you know it's basically 5/7ths of the difference between the 2 dates with 2 optional offsets, it's much faster and cleaner.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform