Super_Collector
Member
- Joined
- Aug 14, 2008
- Messages
- 7
- Programming Experience
- Beginner
I have a 180,000 strings with each string being 300-1,100 characters in length. I want to do a simple substitution for each character of every string.
For X0=1 to 180000
LineIn = Origin(X0)
Y0 = 0
Do
Y0 = Y0 + 1
If asc(Mid(Linein, Y0, 1)) < 126 then Mid(Linein, Y0, 1) = chr(asc(Mid(Linein, Y0, 1)) + 126) else Mid(Linein, Y0, 1) = chr(asc(Mid(Linein, Y0, 1)) - 126)
Loop until Y0 = Len(LineIn)
Origin(X0) = LineIn
Next
The Do : Loop is a time killer. Is there a function that does simple substitution on the string without having to manually check every position?
For X0=1 to 180000
LineIn = Origin(X0)
Y0 = 0
Do
Y0 = Y0 + 1
If asc(Mid(Linein, Y0, 1)) < 126 then Mid(Linein, Y0, 1) = chr(asc(Mid(Linein, Y0, 1)) + 126) else Mid(Linein, Y0, 1) = chr(asc(Mid(Linein, Y0, 1)) - 126)
Loop until Y0 = Len(LineIn)
Origin(X0) = LineIn
Next
The Do : Loop is a time killer. Is there a function that does simple substitution on the string without having to manually check every position?
Last edited: