Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Arrays and variable ...???
Message
De
20/08/1998 13:12:18
 
 
À
20/08/1998 12:59:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00128485
Message ID:
00128557
Vues:
19
>>>I have the following array:
>>>dim array1(5)
>>>array1(1)='h'
>>>array1(2)='e'
>>>array1(3)='l'
>>>array1(4)='l'
>>>array1(5)='o'
>>>
>>>I have the entire word 'hello' stored in the array.
>>>Now can I do this :
>>>
>>>public string1
>>>string1=array()
>>>
>>>or if I can not is there a way that I can pass the whole value
>>>stored in the array as a value to a string variable??
>>>
>>>marcos oliva
>>>thanks
>>
>>Hi,
>>
>>No, you cannot pass the whole array to 1 string var.
>>
>>A quick loop FOR 1 to ALEN( array, 1) and then concatenate each element is the best solution that I can offer.
>
>thanks for your response.
>and how do you go by concatenating all of the array into one
>var??
>
>for 1 to alen(array1,1)
>varx=varx+array(number)
>endfor
>
>perhaps??
>
>marcos oliva

You're pretty close:

lcString = ""
FOR lnIndex = 1 TO ALEN(Array1, 1)
lcString = lcString + array1[lnIndex]
ENDFOR
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform