I was browsing some source code and saw this IF statement:
VB Code:
If m > n Then n = m GetFilename = Mid(Path, n + 1)
it has no END IF. I didn't know you could omit that part.
comments?
Printable View
I was browsing some source code and saw this IF statement:
VB Code:
If m > n Then n = m GetFilename = Mid(Path, n + 1)
it has no END IF. I didn't know you could omit that part.
comments?
You can IF AND ONLY if the statement to execure upon true value is on the same line. That would be the "n = m" part in this case.
"GetFilename = Mid(Path, n + 1)" will ALWAYS run, no matter what the result of the IF statement is.
TG
I can't remember where I've read this, but there may be a bug with using the one line IF statement - memory leak or something. Maybe that's just the compact framework.
interesting. I don't think I'll start using that but definetely worth knowing :)