Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Searching a character string for a character
Message
From
12/11/2017 14:43:49
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
01655511
Message ID:
01655519
Views:
55
>>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform