Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Interleave strings
Message
From
28/04/2009 04:54:01
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
23/04/2009 15:33:18
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01395869
Message ID:
01396623
Views:
57
Hi Walter,

I gave this a try, but unfortunaltly I use chars from 0 to 255, what will not work with STRCONV. ::(

Agnes

>>Hi Walter,
>>
>>as I understand your method mades double bytes out of both strings shift the second 8 bits right and bit connect them?
>>
>>The problem is that I not see how this will work with 10 strings ...
>
>
>Hi agnes,
>
>
>You're right... 2, 4 or 8 is easy to do (1, 2 or 3 times a STRCONV()) function, but anything not being a power of 2 is not possible this way. If speed is a concern, you might choose this method for 2, 4 and 8 strings, but for 6 and 10 choose the earlier (but slower) solution
>
>
>Walter
>
>
>>Agnes
>>>Hi Agnes,
>>>
>>>A total different approach to this problem:
>>>
>>>The following is about 10 times as fast for two strings as the earlier solution, however handling more than two strings needs some additonal logic (process them in pairs and process the result of that again)
>>>
>>>
>>>cStr1 = "ABCDEFGHIJ"
>>>cStr2 = "0123456789"
>>>
>>>cResult = CAST(BITOR(CAST(STRCONV(cStr1,12) as W),SUBSTR(CAST(STRCONV(' '+cStr2,12) as W),2)) as C(LEN(cStr1)*2))
>>>
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Reply
Map
View

Click here to load this message in the networking platform