@@ -56,6 +56,7 @@ UsrIn := ""
5656linkArray := []
5757linkString := ""
5858hsrDup:=0
59+ guiReload:=1
5960
6061; Initialize GUI variables
6162MainGui := Gui ()
@@ -193,6 +194,7 @@ BuildLiteGUI(*)
193194BuildMainGUI(* )
194195{
195196 ; Initially Generated Using SmartGUI Creator 4.0
197+ global guiReload:=1
196198 LoadMenu()
197199 LocalHotkeysOn()
198200 global lastIndex
@@ -221,6 +223,7 @@ BuildMainGUI(*)
221223 linksListbox.Choose(lastLinkIndex)
222224 }
223225 SetLinkHighlight()
226+ guiReload:=0
224227}
225228
226229BuildHSRArray(* )
@@ -324,7 +327,6 @@ ButtonSubmit(*)
324327
325328 if (minMode == 0 ) {
326329 if (activeControl == linksListbox) {
327- ; MsgBox "DING"
328330 if (linkArray[linksListbox.value][2 ] == " *" ) {
329331 linkLabel:=linkArray[linksListbox.value][1 ]
330332 RegExMatch (linkLabel, " <(.*?)>" , & match)
@@ -336,6 +338,7 @@ ButtonSubmit(*)
336338 }
337339 } else {
338340 webSearch(linkArray[linksListbox.value][2 ])
341+ return
339342 }
340343 } else if (activeControl == catListbox) {
341344 linksListbox.Focus()
@@ -442,6 +445,7 @@ ButtonSubmit(*)
442445InputAlgorithm(* )
443446{
444447 global lastLinkIndex
448+ global linkArray
445449 if (minMode == 0 ) {
446450 if (RegExMatch (editBar.value, " ^ .+" ))
447451 {
@@ -455,6 +459,8 @@ InputAlgorithm(*)
455459 try {
456460 try {
457461 usrIndex := Integer(SubStr (editBar.value,2 ))
462+ if (usrIndex>linkArray.length )
463+ usrIndex:=linkArray.length
458464 linksListbox.choose(usrIndex)
459465 lastLinkIndex:=linksListbox.value
460466 } catch {
@@ -491,8 +497,10 @@ LoadLinks(prev*)
491497 global linkArray := []
492498 linksListbox.Opt(" -Redraw" )
493499 linksListbox.Delete ()
500+ ; MsgBox lastLinkIndex "`n" prev[1]
494501 global lastLinkIndex
495- if (prev[1 ]==catListbox)
502+ global guiReload
503+ if (guiReload == 0 && prev[1 ]==catListbox)
496504 lastLinkIndex:=1
497505 Loop HSR_Array.Length
498506 {
0 commit comments