If NOT @LOGONMODE Break OnEndIf Dim $SO,$Key,$wr$SO = SetOption("Explicit","On")$SO = SetOption("NoVarsInStrings","On")$SO = SetOption("NoMacrosInStrings","On") ; Good practice setting the options, including the break on method. ; Minor observation so that other new scripters are aware ; KiXtart can use abbeviations for some of the main Registry keys ;Registry Functions ;All registry functions use the following format to specify registry subkeys: ;[\\remote_computer_name\][Key\]Subkey ;Remote_computer_name can be any valid computer name in UNC format (preceded by two backslashes). ;If you do not specify a remote_computer_name, the program defaults to the local registry. ;Key can be any of the main registry trees: HKEY_LOCAL_MACHINE (or HKLM in short), ;HKEY_USERS (HKU), HKEY_CLASSES_ROOT (HKCR), HKEY_CURRENT_USER (HKCU) or ;HKEY_CURRENT_CONFIG (HKCC). If you do not specify a root key, KiXtart will use ;HKEY_CURRENT_USER as the default. $key='HKEY_CURRENT_USER\Software\','Golfing','Round1','Enterprise Terminal Server' ; A best practice for a production script would be to use var names that have some ; type of meaning that is easily understood. $wr=FindMe($key) ; will return a code to @error: 0 for true, and 1 for not true @error Function FindMe($key)Dim $ch,$found,$index,$valuename,$KeyF,$JoinKey,$Valuename2,$wr,$split,$inst ; Using $key[0] is optomistic. If a user missed a comma or similar typo the ; UDF would end abnormally. ; I'd have to think about how best to modify it without completely changing your code. $ch=KeyExist($key[0]) ; Does the HKEY_CURRENT_USER_\Software\ exist? ; In many cases just an If $var is good enough, but be aware there are times that ; this is not sufficient and could lead to unexpected results. if $ch ; This is along the lines of the $key[0] issue and you've set it so that there ; is a known value to start with which is good. $found=0 $index=0 ;Setting values so the while-statement will not run forever.. while @error=0 and $found=0 $ValueName = ENUMKEY($key[0],$index) if $ValueName = $Key[1] $found=1 ; Need to be careful or at least aware of data types when concatenating data $KeyF=$key[0],$ValueName $JoinKey=Join($KeyF,'') $wr=ReadValue($JoinKey,$Key[2]) $split=Split($wr,'|') $wr=Join($split,' ') $inst=Instr($wr,$Key[3]) if $inst exit 0 else exit 1 endif else $Index = $Index + 1 endif loop exit @errorendif EndFunction ; Overall I'm not comfortable with the calls to array elements without ; some type of prior initialization as it could easily lead to a script abend.
Generated in 0.072 seconds in which 0.023 seconds were spent on a total of 13 queries. Zlib compression enabled.
") !=-1) { tempah=tempah.substring(tempah.indexOf("")+5,tempah.indexOf("")); codes[i].innerHTML="" + dotag(tempah.substring()) + ""; } } //var pres = document.getElementsByTagName("pre"); //for (var i=0, maxi = pres.length; i < maxi; i++) { // var tempah = pres[i].innerHTML; // if (tempah.indexOf("[postprep") !=-1) { // tempah=tempah.substring((tempah.indexOf("]",tempah.indexOf("[postprep"))+1)); // pres[i].innerHTML=dotag(tempah); // } //} function ytag(which_one) { var codes = document.getElementsByClassName("ubbcode-body"); var thisone = codes[which_one].innerHTML; codes[which_one].innerHTML = "" + dotag(thisone.substring(5+thisone.indexOf(""),thisone.indexOf(""))) + ""; var heads = document.getElementsByClassName("ubbcode-header"); heads[which_one].innerHTML = "Code:" + ' '; } function ttag(which_one) { var codes = document.getElementsByClassName("ubbcode-body"); var thisone = ""; if (codes[which_one].innerText != undefined) { thisone += codes[which_one].innerText; } else { thisone += codes[which_one].textContent; } codes[which_one].innerHTML = thisone + ""; var heads = document.getElementsByClassName("ubbcode-header"); heads[which_one].innerHTML = "Code:" + ' '; }
")+5,tempah.indexOf("
" + dotag(tempah.substring()) + "
" + dotag(thisone.substring(5+thisone.indexOf(""),thisone.indexOf(""))) + "
"),thisone.indexOf("
"; if (codes[which_one].innerText != undefined) { thisone += codes[which_one].innerText; } else { thisone += codes[which_one].textContent; } codes[which_one].innerHTML = thisone + "