Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieve value from comma delimited by priority
Message
De
24/11/2009 08:49:33
 
 
À
24/11/2009 08:34:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01436294
Message ID:
01436308
Vues:
43
Thank you.



>Hi Chaim
>
>Please to see if it help you.
>
>
>Local lsString1, lsString2, lsString3, lsStringAll, lsItem as String, liCount as String
>Local array laString[1], laResult[1]
>* 1. UR-6542,UG-4586,UA-5585,UF-8522 = UA-5585
>* 2. UG-1542,UB-8473,UY-9115,UT-7741 = UB-8473
>* 3. UG-1542,UB-8473,UY-9115,UB-2121 = UB-2121 (I have two B so order by digits).
>
>lsString1   = "UR-6542,UG-4586,UA-5585,UF-8522"
>lsString2   = "UG-1542,UB-8473,UY-9115,UT-7741"
>lsString3   = "UG-1542,UB-8473,UY-9115,UB-2121"
>lsStringAll = lsString1 + "," + lsString2 + "," + lsString3
>liCount = ALines(laString, lsStringAll , 5, ",")
>If liCount > 0
>  For each lsItem in laString
>    If !Empty(laResult[1])
>      Dimension laResult[Alen(laResult) + 1]
>    EndIf
>    laResult[Alen(laResult)] = Substr(lsItem, 2)
>  EndFor
>EndIf
>
>Asort(laResult) && sort the result array
>* to see
>For each lsItem in laResult
>  ?lsItem
>EndFor
>
>
>>Hi
>>Help please,
>>
>>
>>I have comma delimited string variable and I have to retrieve only one value by ABC Sequential Order priority (each value start with U, so I have to see ignore the U).
>>
>>For example:
>>
>>1. UR-6542,UG-4586,UA-5585,UF-8522 = UA-5585
>>2. UG-1542,UB-8473,UY-9115,UT-7741 = UB-8473
>>3. UG-1542,UB-8473,UY-9115,UB-2121 = UB-2121 (I have two B so order by digits).
>>
>>Tnx
Thank you
Chaim
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform