Hi,
basically what i want to do is to return to the code that is in "Catch ex As Exception" when some string has for example value of 1 and etc...
So i have this code (iam making a game, theres a file deleting system (the files are fake))
What i want to do, is to return a exception to execute this code:
When
has a value of
and the fileToDel variable has for example value of "news.jpg" (because this file is not in root directory but in "latest" so you cant delete if from other dir.
lvl1f is declared like this:
BTW a question for dictionarys, is there a way to know the index or w/e of a key ? So i have a list like this:
Is there some way to know the number of some key ? So for example index.php will be 1 (or 0 like in arrays) and log.txt will be 4 (or 3 like in arrays)
basically what i want to do is to return to the code that is in "Catch ex As Exception" when some string has for example value of 1 and etc...
So i have this code (iam making a game, theres a file deleting system (the files are fake))
Code:
'=====LEVEL1===========
If My.Settings.Level = 1 Then
'=====IF IN "Latest"
If lvl1f("InLatest") = "1" Then
'If deleting index.php in "latest" directory
If fileToDel = "index.php" Then
lvl1f("index.php.latest") = ""
consolebox.Text &= String.Format("Succesfully deleted '{0}'", fileToDel & newline)
tscroll()
Return
End If
'End of deleting index.php
'Other files in "latest" directory
'Those files will be there after i will finish this..
End If
'=======END OF IN LATEST========
'If fileToDel = "news.jpg" Then return_exception_code_here
lvl1f(fileToDel) = ""
End If
'======END OF LEVEL1==========
consolebox.Text &= String.Format("Succesfully deleted '{0}'", fileToDel & newline)
tscroll()
Catch ex As Exception
consolebox.Text &= String.Format("File not found ('{0}'", fileToDel & newline)
End Try
Return
End If
Code:
consolebox.Text &= String.Format("File not found ('{0}'", fileToDel & newline)
Code:
lvl1f("InLatest"
Code:
0
lvl1f is declared like this:
Code:
Dim lvl1f As New Dictionary(Of String, String)
Code:
lvl1f.Add("index.php", "index.php")
lvl1f.Add("register.php", "register.php")
lvl1f.Add("latest", "latest <DIR>")
lvl1f.Add("log.txt", "log.txt")
lvl1f.Add("style.css", "style.css")
lvl1f.Add("InLatest", "0")
lvl1f.Add("index.php.latest", "index.php")
lvl1f.Add("main_page_style.css", "main_page_style.css")
lvl1f.Add("news.jpg", "news.jpg")