Go Back   Computer Forums > General Computing > Programming
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 07-21-2008, 09:49 AM   #1
Neodude112320's Avatar
Join Date: Feb 2006
Location: Australia
Posts: 8,471
Send a message via MSN to Neodude112320
Default End of Statement Expected?

Ok,here is the part of the code i need help with:

Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
Dim FileToCopy As String
Dim NewCopy As String

FileToCopy = Form1.add.FileName
NewCopy = "C:\" + TextBox1.Text + ".ink"
If System.IO.File.Exists("C:\" + TextBox1.Text + ".ink") = True Then MsgBox("File Already Exist's")

If System.IO.File.Exists(FileToCopy) = True Then
System.IO.File.Copy(FileToCopy, NewCopy)

MsgBox("Shortcut Added")
End If

End Sub

If you notice on line 8,if a file already exists with the same name,a message box appears,but the script continues,how can i make this text make that message box appear,THEN allow the user to re-enter a name?

Desktop:BitFenix Survivor~Gigabyte GA-P67A-UD3R~ i7 2600K @ 4hz~AMD 6870 1GB~12gb Team Elite DDR3 1333~3xWD In RAID5~W7 Ult
Laptop:Alienware M11x~ i7-2637M 1.7GHz~16GB 1333MHz DDR3~GeForce GT 540M~W7 Ult
Neodude112320 is offline   Reply With Quote
Old 07-21-2008, 01:34 PM   #2
JogaBonito1502's Avatar
Join Date: Jan 2008
Location: U.S.
Posts: 7,841
Default Re: End of Statement Expected?

I haven't messed with VB in a while, but I think you can make another message box pop up (I believe it's called an input box) and you can extract information from there. Also, to make this go on until the names don't match you can do a while loop if you know what those are.
JogaBonito1502 is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

All times are GMT -5. The time now is 12:09 AM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2016, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0