Need some help 
Author Message
 Need some help

Hello all,

I want to take out some numbers out of a line from the right side,

For example my line is 0123456789 and I want to
take out from right position 1,2,3 and 5 so that the result is 5789

I can not use the function Mid (. . . . .) because that is taking out
from the left side of the line.

Does anybody know a solutio"?
Thanks in advance



Sat, 25 Oct 2003 17:41:40 GMT  
 Need some help
Use the Right() function...

Paul.


Quote:
> Hello all,

> I want to take out some numbers out of a line from the right side,

> For example my line is 0123456789 and I want to
> take out from right position 1,2,3 and 5 so that the result is 5789

> I can not use the function Mid (. . . . .) because that is taking out
> from the left side of the line.

> Does anybody know a solutio"?
> Thanks in advance



Sat, 25 Oct 2003 18:12:44 GMT  
 Need some help
Of course you can use Mid().
Just substract 1,2,3 and 5 (taken from your example) to the LENGTH of your
string:
(Len(string)+1) -1, (Len(string)+1) -2, (Len(string)+1) -3,
(Len(string)+1) -5.


Sat, 25 Oct 2003 19:14:49 GMT  
 Need some help

Reverse the string

myStr = "1234565789"
newStr = ""

for x = len(myStr) to 1 step -1
    newStr = newStr & mid(Mystr,x,1)
next x

now myStr is equal to 987654321

and you can work with mid

Frank.



Sat, 25 Oct 2003 19:40:03 GMT  
 Need some help


Quote:

> Reverse the string

> myStr = "1234565789"
> newStr = ""

> for x = len(myStr) to 1 step -1
>     newStr = newStr & mid(Mystr,x,1)
> next x

> now myStr is equal to 987654321

> and you can work with mid

> Frank.

It would be better to dimension the string before entering the loop:

myStr = "1234565789"
newStr = myStr
x = Len(myStr)  + 1
for i = 1 To x - 1
  Mid(newStr, i, 1) = Mid$(myStr, x - i, 1)
next i

LFS



Wed, 29 Oct 2003 22:42:07 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. need need help help (911)!!!!!

2. Tutor needed - Help,Help, Help!!!

3. Need some help with some Access coding if someone could please help =)

4. Need help - Help please!

5. Help needed for Help Construction!!

6. HELP, I need Somebody, HELP :)) - SQL

7. VB Help needed Please Help

8. Help need some help with variales

9. SOMEONE HELP PLEASE---NEED VB HELP

10. Urgent help needed please help

11. URGENT help needed, please help

12. Help Me i need menu help

 

 
Powered by phpBB® Forum Software