Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27355

VS 2008 Problem with string array and If operator

$
0
0
Hi !
Iam making a game, kinda like "HackTheGame" the main idea is like you get a mail with details and you have to 'hack' into some server..dont worry its all fake and its not even close to hacking.I have a problem, because i used to store the files on the server in a string array, and then if someone disconnects from the 'server' it checks if the files were deleted.
First thing i do after disconnecting is this:
Code:

If lvl1f(0) = "" & lvl1f(3) = "" & lvl1f(4) = "log.txt" Then
'Deleted the files, but left the log file
End If

and the values are set like this:
Code:

        Dim lvl1f(4) As String
        lvl1f(0) = "index.php"
        lvl1f(1) = "register.php"
        lvl1f(2) = "style.css"
        lvl1f(3) = "latest <DIR>"
        lvl1f(4) = "log.txt"

When the guy is 'deleting' the file the value is cleared, so for example when he deletes index.php it does lvl1f(0) = ""

The problem is, when it checks if the files were deleted, it gives a error :(
[quote]
Conversion from string "" to type 'Boolean' is not valid.[/code]
And it gives a arrow to the "log.txt" code, heres a screenshot:
Name:  errorbi.png
Views: 64
Size:  5.7 KB
Attached Images
 

Viewing all articles
Browse latest Browse all 27355

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>