dim i% and overflow issue

J

Joy

Public Sub ProcessContent(ByVal content$, part1$, part2$)

Dim i%
content$ = Trim(content$)

i = InStr(content$, "#")
If i > 0 Then part1$ = Left(content$, i - 1)
part2$ = Mid(content$, i + 1, Len(content$) - i)

End Sub

does anyone know what does " Dim i%" mean?

why use Dim i%?? instead of like dim I as long

I got overflow error in i = InStr(content$, "#")
if InStr(content$, "#") is too large a number, what is the best way to deal
with it?
 
S

Seawolf

This is almost ancient Sanscrit and dates from MSDos Basic, that declaration
was deprecated at VB2, though you can still use it with VB6.

The % indicates an Integer type, not a LONG, therefore the following
statements..

Dim I%

Dim I as Integer

...are the same.

If you are getting an overflow error from your INSTR function then the
returned value is probably greater than 32768, try changing the I declaration
to LONG. Since I can't recall any MSP property strings of this length, I'm
assuming this is not MS Project related.
 
J

Joy

thanks

Seawolf said:
This is almost ancient Sanscrit and dates from MSDos Basic, that declaration
was deprecated at VB2, though you can still use it with VB6.

The % indicates an Integer type, not a LONG, therefore the following
statements..

Dim I%

Dim I as Integer

..are the same.

If you are getting an overflow error from your INSTR function then the
returned value is probably greater than 32768, try changing the I declaration
to LONG. Since I can't recall any MSP property strings of this length, I'm
assuming this is not MS Project related.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top