1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-05 22:50:23 +00:00

Update ide_methods.bas

This commit is contained in:
SteveMcNeill 2022-05-18 11:12:49 -04:00
parent bd3b673996
commit 459c8a216d

View file

@ -17668,23 +17668,11 @@ FUNCTION idesearchedbox$
ln = 0 ln = 0
l$ = "" l$ = ""
fh = FREEFILE REDIM SearchHistory(0) AS STRING
OPEN ".\internal\temp\searched.bin" FOR BINARY AS #fh: a$ = SPACE$(LOF(fh)): GET #fh, , a$ RetrieveSearchHistory SearchHistory()
a$ = RIGHT$(a$, LEN(a$) - 2) FOR i = 1 to UBOUND(SearchHistory)
DO WHILE LEN(a$) l$ = SearchHistory(i) + sep + l$
ai = INSTR(a$, CRLF) NEXT
IF ai THEN
f$ = LEFT$(a$, ai - 1): IF ai = LEN(a$) - 1 THEN a$ = "" ELSE a$ = RIGHT$(a$, LEN(a$) - ai - 3)
IF LEN(l$) THEN l$ = l$ + sep + f$ ELSE l$ = f$
ln = ln + 1
END IF
LOOP
CLOSE #fh
IF ln = 0 THEN
l$ = sep
END IF
'72,19 '72,19
h = idewy + idesubwindow - 9 h = idewy + idesubwindow - 9
@ -18600,7 +18588,7 @@ FUNCTION removeDoubleSlashes$(f$)
END FUNCTION END FUNCTION
SUB IdeAddSearched (s2$) SUB IdeAddSearched (s2$)
s$ = s2$ + CHR$(10) s$ = s2$ + CRLF
fh = FREEFILE fh = FREEFILE
OPEN ".\internal\temp\searched.bin" FOR BINARY AS #fh: a$ = SPACE$(LOF(fh)): GET #fh, , a$ OPEN ".\internal\temp\searched.bin" FOR BINARY AS #fh: a$ = SPACE$(LOF(fh)): GET #fh, , a$
x = INSTR(UCASE$(a$), UCASE$(s$)) x = INSTR(UCASE$(a$), UCASE$(s$))
@ -19986,13 +19974,18 @@ END FUNCTION
SUB RetrieveSearchHistory (SearchHistory() as string) SUB RetrieveSearchHistory (SearchHistory() as string)
fh = FREEFILE fh = FREEFILE
OPEN ".\internal\temp\searched.bin" FOR BINARY AS #fh OPEN ".\internal\temp\searched.bin" FOR BINARY AS #fh
redim _preserve SearchHistory(1 to 10000) 'large initial array to hold the data redim _preserve SearchHistory(1 to 10000) AS STRING 'large initial array to hold the data
IF LOF(FH) THEN
Do until eof(fh) Do until eof(fh)
ln = ln + 1 ln = ln + 1
if ln > ubound(SearchHistory) then redim _preserve SearhHistory(1 to ln + 10000) 'large resize, it necessary if ln > ubound(SearchHistory) then redim _preserve SearhHistory(1 to ln + 10000) AS STRING 'large resize, it necessary
line input #fh, SearchHistory(ln) line input #fh, SearchHistory(ln)
Loop Loop
redim _preserve SearchHistory(1 to ln) 'resize to proper size before exit redim _preserve SearchHistory(1 to ln) AS STRING'resize to proper size before exit
ELSE
REDIM SearchHistory(1) AS STRING
SearchHistory(1) = ""
END IF
CLOSE #fh CLOSE #fh
end sub end sub