[RESOLVED] What's wrong plz? Reversing string
Hi all, and thanks in advance:)
can you please tell me what is wrong here? I am traying to Reverse a String which is not only backword...it like you look at the String in front of you or like it is in the Mirror. becouse it is in arabic lang. the other problem here it is like bringing the last string with the new one:(
1- I want the reverse order for string.
Do While Not EOF(1)
Line Input #1, sIN
For I = Rec_size To 0 Step -1
T = T & Mid(sIN, 1, 1)
sIN = Mid(sIN, 2)
Next I
Print #2, T
W = " "
Loop
Re: What's wrong plz? Reversing string
Have you tried the StrReverse function?
Re: What's wrong plz? Reversing string
Yes i did and it does not work with it becous i have to go thru the loop like from postion 133 to postion one..my propleam is that itis like the line of string in the wall and you want to go back from right to lift...:( becouse of some font shape i have to deal with:(
Re: What's wrong plz? Reversing string
even like the code i post i get now a blind becouse i can not see the stupen mistake i am missing..:(
Re: What's wrong plz? Reversing string
Can you give an example of the input file and of the wanted outcome?
Re: What's wrong plz? Reversing string
T = T & Mid(sIN, 1, 1)
That takes the first character of sIN and adds it to T instead of the last. Your code should probably read:
VB Code:
For I = Rec_size To 1 Step -1
T = T & Mid(sIN, I, 1) '<- Notice that the second argument uses the I variable instead of 1
Next I