Here is my practice code:
I get an error of
Error 1 Type character '$' does not match declared data type 'Integer'.
Error 2 'Public ReadOnly Property Right() As Integer' has no parameters and its return type cannot be indexed.
For Line...sExtension = UCase$(Right$(txtFile.Text, 3))
What exactly am I doing wrong?
Thanks
Patster
Public Class frmMain
Private Sub cmdView_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdView.Click
Dim sExtension As String
Dim iReturnValue As VariantType
sExtension = UCase$(Right$(txtFile.Text, 3))
If Dir$(txtFile.Text) = "" Then
MsgBox("Sorry, I couldnt find that file!" & vbCrLf & "It may be hidden.", vbExclamation)
Exit Sub
ElseIf sExtension = "TXT" Then
iReturnValue = Shell("Notepad " & txtFile.Text, 1)
ElseIf sExtension = "BMP" Then
iReturnValue = Shell("PBrush " & txtFile.Text, 1)
End If
End Sub
End Class
I get an error of
Error 1 Type character '$' does not match declared data type 'Integer'.
Error 2 'Public ReadOnly Property Right() As Integer' has no parameters and its return type cannot be indexed.
For Line...sExtension = UCase$(Right$(txtFile.Text, 3))
What exactly am I doing wrong?
Thanks
Patster