Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A tangled string
Message
De
31/12/2011 15:12:56
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01531969
Message ID:
01531989
Vues:
53
>>>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.
>>>
>>>thanks
>>>k
>>
>>put into an array
>>
>>ALINES(aMesa,m.mesa,".")
>>
>
>Thank you fabio, sadly i'm not familiar enough with array to display it so could not get anywhere with this one.
>k

An array is a single variable name, which contains several values. The values are distinguished by an index.

First, you can check it in the debugger, to see its different elements. Thus, you will verify that the alines() command worked correctly.

Here is a sample program to show the array elements:
for i = 1 to alen(aMesa)
  ? aMesa(i)
next
Similarly, you can access any element of the array for any other purpose, through its index.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform