vb.net - BC30451 'VARIABLE' is not declared. It may be inaccessible due to its protection level -
i seem have error code below.
private sub form1_load(sender object, e eventargs) handles mybase.load me.centertoscreen() if my.computer.filesystem.fileexists("bin\php\php.exe") dim phprc string = "" dim php_binary string = "bin\php\php.exe" else dim php_binary string = "php" end if if my.computer.filesystem.fileexists("pocketmine-mp.phar") dim pocketmine_file string = "pocketmine-mp.phar" else if my.computer.filesystem.fileexists("src\pocketmine\pocketmine.php") dim pocketmine_file string = "src\pocketmine\pocketmine.php" else msgbox("couldn't find valid pocketmine-mp installation", msgboxstyle.exclamation, "pocketmine-mp") end if end if process.start("c:\users\damian\desktop\games\pocketmine\installer\pocketmine-mp\bin\mintty.exe", "-o columns=88 -o rows=32 -o allowblinking=0 -o fontquality=3 -o font='dejavu sans mono' -o fontheight=10 -o cursortype=0 -o cursorblinks=1 -h error -t 'pocketmine-mp' -i bin/pocketmine.ico -w max" & php_binary & "" & pocketmine_file & "" & "--enable-ansi") end sub
i keep on getting error
bc30451 'php_binary' not declared. may inaccessible due protection level.
bc30451 'pocketmine_file' not declared. may inaccessible due protection level.
what doing wrong?
(fyi, in form1_load test reasons.)
you're dimming 2 variables within if statements, once hit "end if" variables gone, or "out of scope". should research on variable scope... fix in code, first declare strings top, inside sub outside of if statements. use if statements change variables hold; way, when process call comes up, variables not out of scope:
private sub form1_load(sender object, e eventargs) handles mybase.load me.centertoscreen() dim php_binary string = nothing dim pocketmine_file string = nothing if my.computer.filesystem.fileexists("bin\php\php.exe") php_binary = "bin\php\php.exe" else php_binary = "php" end if if my.computer.filesystem.fileexists("pocketmine-mp.phar") pocketmine_file = "pocketmine-mp.phar" else if my.computer.filesystem.fileexists("src\pocketmine\pocketmine.php") pocketmine_file = "src\pocketmine\pocketmine.php" else msgbox("couldn't find valid pocketmine-mp installation", msgboxstyle.exclamation, "pocketmine-mp") end if end if process.start("c:\users\damian\desktop\games\pocketmine\installer\pocketmine-mp\bin\mintty.exe", "-o columns=88 -o rows=32 -o allowblinking=0 -o fontquality=3 -o font='dejavu sans mono' -o fontheight=10 -o cursortype=0 -o cursorblinks=1 -h error -t 'pocketmine-mp' -i bin/pocketmine.ico -w max" & php_binary & "" & pocketmine_file & "" & "--enable-ansi") end sub
Comments
Post a Comment