Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Interleave strings
Message
 
 
À
22/04/2009 06:52:11
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01395869
Message ID:
01395871
Vues:
136
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform