Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Interleave strings
Message
 
 
To
22/04/2009 06:52:11
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01395869
Message ID:
01395871
Views:
135
Hi Agnes,

I'm not sure how fast it's but it's short and easy to test. :)
DIMENSION laStrings[2]
laStrings[1] = "ABCDEFGHIJ"
laStrings[2] = "0123456789"

lnStrCount = ALEN(laStrings)
lnStrLen = LEN(laStrings[1])
lcStr = ""

FOR i=1 TO lnStrLen 
	FOR j=1 TO lnStrCount
		lcStr = lcStr + SUBSTR(laStrings[j], i, 1) 
	ENDFOR
ENDFOR

? lcStr
>
>I'm looking for the fastest way to interleave strings.
>Problem:
>
>*given strings
>lc1 = 'ABCDEFGHIJ'
>lc2 = '0123456789'
>
>*Result
>='A0B1C2D3E4F5G6H7I8J9'
>
>
>I need to interleave 2,4,6, 8 or 10 strings (a 1 string interleave exists too)
>The string lenght is even.
>
>(For those interested, this is the error corection on a DataMatrix Barcode, see http://grandzebu.net/index.php?page=/informatique/codbar/datamatrix.htm and http://grandzebu.net/informatique/codbar/datamatrix.xls)
>
>I appreciate any idea
>
>Agnes
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform