Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Produce a Complex String
Message
From
10/12/2007 13:15:54
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01274465
Message ID:
01274492
Views:
16
Here is my solution taken from the help of you all:

CLEAR
SET EXACT On
partnoS = ""
partnoS2 = ""
recseqS2 = ""
lcString = ""

SELECT testQuery

lcString = ""
SCAN

IF NOT ALLTRIM(testQuery.partno) == partnoS Then
IF NOT RIGHT(recseqS2,2) == ")," Then
recseqS2 = SUBSTR(recseqS2,1,LEN(recseqS2)-2)
recseqS2 = recseqS2 + "),"
EndIf
lcString = "),"
recseqS2 = recseqS2 + ALLTRIM(testQuery.partno) + "("+recseq+lcString

ELSE
IF RIGHT(recseqS2,2) == ")," Then
recseqS2 = SUBSTR(recseqS2,1,LEN(recseqS2)-2)
recseqS2 = recseqS2 + ","
EndIf
lcString = ","
recseqS2 = recseqS2 + recseq+lcString
ENDIF
partnoS = ALLTRIM(testQuery.partno)

ENDSCAN
recseqS2 = SUBSTR(recseqS2,3,LEN(recseqS2))
recseqS2 = SUBSTR(recseqS2,1,LEN(recseqS2)-1)
recseqS2 = recseqS2 + ")"
? recseqS2
Previous
Reply
Map
View

Click here to load this message in the networking platform