Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Retrieve value from comma delimited by priority
Message
From
24/11/2009 08:34:27
 
 
To
24/11/2009 08:21:00
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01436294
Message ID:
01436303
Views:
43
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform