I am getting an error about some nested 'if then else' statements. I cannot see any line missing a semicolon. Have I not written the nested if statements correctly? There is nothing but comments prior to the function declaration. I have to get two more languages, but I need the code to work before I do that.
This is the error message. The line number indicates that it the line containing "_AdblockSubs_help {" which throws the error.
Fri Jan 22 2016 15:10:32
Error: ; expected but found {.
Source file: C:\Program Files\K-Meleon76Beta3\Profiles\yftjcc2b.default\macros\adblocksubs.kmm
This is the code.
function KMListBoxLang($__code) {
$_KMListBox_Macro_Path=getfolder(UserMacroFolder)."\\KMListBox" ;
$__CC = "go" ;
if ( $__code == "en" ) { $__fl = "english._en" ;
} else {
if ( $__code == "de" ) { $__fl = "deutsch._de" ;
} else {
if ( $__code == "fr" ) { $__fl = "français._fr" ;
} else {
if ( $__code == "es" ) { $__fl = "español._es" ;
} else {
alert(_("language provided."), _("No matching"), EXCLAIM) ;
$__CC = "stop" ;
}
if ($__CC == "go") {
$RETURN = copyfile($_KMListBox_Macro_Path."\\language\\".$__fl, $_KMListBox_Macro_Path."\\KMLBlang.dat") ;
setpref( STRING, "k-meleon_KMListBox_language", $__code) ;
}
}
_AdblockSubs_help {
alert("help", "Help", INFO);
}
_AdblockSubs_language {
$__Lcode = substr( getpref( STRING, "intl.accept_languages"), 0 , 2 );
if ( $__Lcode == getpref(STRING, "k-meleon_KMListBox_language") ) {
alert("match", "Languages");
} else { KMListBoxLang($__Lcode); }
}