Ok, I am writing a program that will check a text box and see if it is a valid file to execute. I have a text box and a command button. My method is to use the Left() function and when you click on the command button, what it will do is it will check to see that the text box contains a valid file extension.

So lets say, a valid file name i call ends with .exe

the text box reads c:\example\test.exe

with my program, the left() will hold "exe" part and since that i have already defined as a valid file extension, it will execute it. If lets say the text box read:

c:\example\test.jpg

it will not execute it.

So, this is my code"


Dim strCheck As String

strCheck = Left(txtFile.Text, 3)

And i know this should work, because i have used LEFT function. But now, on my Visual Basic 6 Ent. Edition, it doesn't work. Like after I type in Left( a popup thing should come up indicating i should type in a string and an integer. But that does not happen. And it doesn't work.

Anyone know what i am talking about? if you do, plz help. i'd greatly appreciate it. thanks.