Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ATC not working as expected
Message
 
À
09/09/1998 14:51:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00134721
Message ID:
00134812
Vues:
9
The ATC() function takes the string to look for as the FIRST parameter, you're passing it as the second. If you reverse your first two parameters you'll get the results you're looking for.

>I have a description field that I am trying to retrieve information from to use in new fields. I thought ATC would work but it keeps returning 0 as the value. Using the below example, I expect ATC(Desc, " ", 4) to return 21 (the position of the 4th occurence of a space). ln_position would have a value of 6. lc_invno would have a value of 123456. Which is what I want.
>
>However, ATC(Desc, " ", 4) is always returning 0, so ln_position always has a value of -15 and in the below example returns 123456 0100. What am I doing wrong? BTW, V# will always be 6 positions, but IV# can be 1 to 10 positions.
>
>TIA for your help! :)
>
>Desc = V# ABC001 IV# 123456 0100
>
>ln_position = (ATC(Desc, " ", 4) - 15)
>
>IF ln_position < 0
> lc_invno = ALLTRIM(SUBSTR(Desc, 15, 21))
>ELSE
> lc_invno = SUBSTR(Desc, 15, ln_position)
>ENDIF
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform