Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Produce a Complex String
Message
De
10/12/2007 12:54:16
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
10/12/2007 11:38:08
Steven Dyke
Safran Seats USA
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01274465
Message ID:
01274482
Vues:
10
>An example of my data:
>
>Part No Recseq
>854411-401 0000001
>854411-402 0000002
>854411-403 0000003
>854411-405 0000004
>854411-405 0000005
>854411-405 0000006
>854411-407 0000007
>
>My desired string:
>854411-401(000001),854411-402(000002),854411-403(0000003),854411-405(0000004,0000005,0000006),854411-407)
>
>This is the code I have came up with which almost works except it puts an ")" after the first -405 recseq number and no ")" after the last -405 recseq number(any multiple part numbers).


I'd rather do it like this:
CLEAR
SET EXACT On
partnoS = ""

SELECT testQuery
locate
do while !eof()
   partnoS = ALLTRIM(partno)
   lcCurrent=partno
   lcComma="("
   SCAN while partno=lcCurrent
      partnoS=partnoS+lcComma+alltrim(recseq)
      lcComma=","
   endscan
   partnoS=partnoS+")"
ENDdo

? partnoS

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform