Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A tangled string
Message
 
À
31/12/2011 04:21:32
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01531969
Message ID:
01531982
Vues:
52
brilliant Dragan - i see the logic, but could not have created this in years. many many thanks.
this is what i used
for i=1 to getwordcount(mesa, ".")
? getwordnum(mesa, i, ".")
endfor

i actually had used chr(13) in the compilation of the mesa variable but it did not translate into the text -

k

>>i have a text string of multiple short sentences each separated by periods stored in a variable called mesa
>>i would like to display the string with each sentence occupying a new line
>>if i use
>>? mesa
>>i get a run-on string
>>i would like to use
>>? subs(mesa,1,??)
>>? subs(mesa,??+1,??) (where ?? is the location of each period)
>>
>>
>>How can i locate and store each of the numerical placements of the periods to build up my substring segments
>>or is there a more efficient way to do this.
>
>There's a dozen ways to do this. One would be to insert a carriage return after each period:
>
>
m2=strtran(mesa, ".", "."+chr(13))
>?m2
>
>Or
>
for i=1 to getwordcount(mesa, ".")
>   ?getwordnum(mesa, i, ".")
>endfor
>
>You could also use aLines(), using "." as the separator.
>
>However, if you have any ellipsis or a period as a part of a word (as in version numbers, IP address, European style ordinal numbers, American style decimal numbers), then you'll get a mess.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform