Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert a delimited string to an array
Message
From
07/09/1999 05:20:52
Schabbach Stefan
Software Für Das Handwerk
Trier, Germany
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00259451
Message ID:
00261875
Views:
19
Hello Scott !

Hiere are 2 other solutions for your Problem:

*** 1st Solution via SUBSTR
cString = "123 12 456 123456 123, 32,99 999, 88 777777,,123,"
cDelimiter = ","
nElements = OCCURS( "," , cString )
DIMENSION cArray( nElements )
FOR ij = 1 TO nElements
cArray( ij ) = SUBST( cString , AT( cDelimiter , cDelimiter + cString , ij ) , AT( cDelimiter , cDelimiter + cString , ij +1 ) -AT( cDelimiter , cDelimiter + cString , ij ) -1 )
? cArray( ij )
ENDFOR


*** 2nd Solution via MEMLINES
cString = "123 12 456 123456 123, 32,99 999, 88 777777,,123,"
cDelimiter = ","
cNewstring = CHRTRAN( cString , cDelimiter , CHR(13) )
nElements = MEMLINES( cNewstring )
DIMENSION cArray( nElements )
FOR ij = 1 TO nElements
cArray( ij ) = MLINE( cNewstring , ij )
? cArray( ij )
ENDFOR
Previous
Reply
Map
View

Click here to load this message in the networking platform