|
-
Dec 22nd, 2024, 10:40 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] why MID$() was featureless in VB6?
My original post, was a mistake.
but, anyway, I tested things that maybe aren't in the help, that is good to know.
mid$(s,2,2) = "bcabrffe" ' will only copy the first two characters. as expected.
mid$(s,2)= "abccdeeff" ' will copy everything and paste it starting from the pointed position. but if the original string length is not large enough, it will only copy what it fits within the original string size
mid$(s,2,5) = "2affbccccc" if not fits, it will be cut, overriding the explicit length to copy, it won't expand the original string size.
A starting offset that is not currently allocated, like S="123":Mid$(S,5,2) = "ab" ' will result in error 5, bad procedure call.
this is the faster way to paste thing where the size of the thing do not change.
Last edited by flyguille; Dec 23rd, 2024 at 06:55 AM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|