Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Searching a character string for a character
Message
De
12/11/2017 14:43:49
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Divers
Thread ID:
01655511
Message ID:
01655519
Vues:
53
>>>I feel really stupid but I have been working half the night and i feel stupid
>>>
>>>I have a character string which can be of variable length
>>>
>>>There are 20 variations of the string
>>>
>>>I need to find the position of the - * in each string so that I know the length of the preceeding text
>>>
>>>Examples
>>>
>>>colin*ssssss so that the answer is 6
>>>
>>>colinnorth*cccc - here the answer is 11
>>>
>>>I feel daft for asking
>>
>>
?at('*',lcString)
>
>
>My code now is
>
>STORE "COL*IN" TO lcstring
>
>
?at('*',lcString)
>
>I get an error
>
>Sorry to be so stupid

***Try This

STORE "COL*IN" TO lcstring
?AT('*',lcString) && Will Display 4 on The Screen
WAIT WINDOW AT('*',lcString) && Will Display an Error

STORE "COL*IN" TO lcstring
nPosition=AT('*',lcString)
? nPosition && Will Display 4 on The Screen
Wait window nPosition && Will Display 4 on Wait Window Location
Harsh
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform