Mid returning Zero Length String - sort of 
Author Message
 Mid returning Zero Length String - sort of

VB6
I'm having a problem with the following statement.
The Help files state:
"If start is greater than the number of characters in string, Mid
returns a zero-length string ("")."

So I am using the code below to exit a loop once the Counter(ctrT)
exceeds the string length. It works in Immediate mode, but while
stepping through the code in the IDE I see that it is returning (")
instead of ("").

If Mid(pText, ctrT, 1) = "" Then Exit Do

I tried a couple of variations with no luck. I can't seem to test for
(").

Thanks for any help.

--
Stephen Lebans

http://www.*-*-*.com/ ~slebans/



Wed, 16 Jan 2002 03:00:00 GMT  
 Mid returning Zero Length String - sort of
Damn, my mistake. The Mid function was working correctly. I had been
using InStr in code above the line containing the Mid function to test
for vbCrLf. I changed this to Mid so the test was failing and I was then
not at the end of the string.

It's 1:06 am Saturday morning here. Hopefully most of you have a life
and I didn't waste too much of anyone's time.<bg>

:-)

--
Stephen Lebans

http://www.geocities.com/~slebans/

Stephen Lebans wrote

Quote:
> VB6
> I'm having a problem with the following statement.
> The Help files state:
> "If start is greater than the number of characters in string, Mid
> returns a zero-length string ("")."



Wed, 16 Jan 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Replace Function returns Nothing instead of Zero-length string

2. GetComputerName returns zero length string

3. Jet OleDB: Allow zero Length property returns True

4. Mid(string, start[, length])

5. Passing fixed length string to API and is returning nulls in string

6. Allow Zero Length String in a field using SQL

7. Convert Zero-Length String to Null

8. ADO - zero length strings

9. Nulls / Zero Length Strings -Newbie Question

10. Newbie Question - Nulls vs zero length strings ???

11. Help please, with Zero-Length String !!

12. Zero Length String error

 

 
Powered by phpBB® Forum Software