Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Journal works OK but throw warning BC42020 when compiling.

Status
Not open for further replies.

Ehaviv

Computer
Jul 2, 2003
1,012
0
0
IL
Hi

Compile throw this warning:

Code:
warning BC42020: Variable declaration without an 'As' clause; type of Object assumed.
 Public Function select_text_file(ByRef partFullPathName) As DialogResult

For this function:

Code:
 Public Function select_text_file(ByRef partFullPathName) As DialogResult
   Dim ofd As OpenFileDialog = new OpenFileDialog()
   Dim result As DialogResult
   ofd.Title = "Select assembly part"
   ofd.AddExtension = true
   ofd.DefaultExt = "prt"
   ofd.Filter = "Files(*.txt;)|*.txt;"
   ofd.FilterIndex = 1        
   ' start browsing at current folder, uncomment for any other default directory
   ' ofd.InitialDirectory = GetEnvironmentVariable("UGII_BASE_DIR")
   ' ofd.InitialDirectory = GetEnvironmentVariable("UGII_BASE_DIR") + "\Moldwizard"
   ' ofd.InitialDirectory = "c:\mypath1\mypath2"
   result = ofd.ShowDialog()
   partFullPathName = ofd.filename
   ofd.Dispose()
   Return result

 End Function

Please can somone help to get rid from this compile warning.
Thank you.
 
Replies continue below

Recommended for you

Assuming "partFullPathName" is a string:

Code:
Public Function select_text_file(ByRef partFullPathName [highlight #FCE94F]as String[/highlight]) As DialogResult

Edit as necessary to match the type of "partFullPathName".

www.nxjournaling.com
 
Hi Cowski
Thank you very much.

Double eyes is better.
I was confused with the As of
Dialogresult and I don't see the
lack of the As String.

Thank you.
 
Status
Not open for further replies.
Back
Top