_TITLE "Highlight QB64 words" 'B+ 2019-03-12
'get list of qb words
Split1000 fs$
, CHR$(13) + CHR$(10), qb
()'FOR i = 0 TO 20
' PRINT i, qb(i)
'NEXT
'SLEEP
'now get a bas file to highlite
loadFA "*.bas", fList()
fnum = -1
COLOR &HFF00FFFF, &HFF000000 COLOR &HFFFFFF00, &HFF000000 PRINT:
INPUT "Just press enter for more, u for up, q to quit, or file number to select "; choice$
Split1000 fs$
, CHR$(13) + CHR$(10), basFile
() apost
= INSTR(basFile
(i
), "'") fLine$
= MID$(basFile
(i
), 1, apost
- 1): tagOn$
= MID$(basFile
(i
), apost
) fLine$ = basFile(i): tagOn$ = ""
Split1000 fLine$, " ", wline()
Split1000 wline(j), "(", parts()
found = 0
addp$
= ",": test$
= LEFT$(parts
(K
), LEN(parts
(K
)) - 1) addp$
= ":": test$
= LEFT$(parts
(K
), LEN(parts
(K
)) - 1) addp$
= ")": test$
= LEFT$(parts
(K
), LEN(parts
(K
)) - 1) addp$ = "": test$ = parts(K)
'highlight word
COLOR &HFF0000FF, &HFF000000 COLOR &HFF00FFFF, &HFF000000 COLOR &HFF00FFFF, &HFF000000 COLOR &HFFFFFF00, &HFF000000 PRINT:
INPUT "Just press enter for more, u for up, q to quit "; choice$
CHDIR ".." '>>>>>>>>>>>>>>>>>>>>>>> you might not want to do this depending where you run this from CONST TmpFile$
= "DIR$INF0.INF" 'SHELL _HIDE "DIR " + spec$ + " /b > " + TmpFile$
SHELL _HIDE "DIR " + spec$
+ " /b /s /o:gen> " + TmpFile$
Index% = -1
Index% = Index% + 1
'notes: REDIM the array(0) to be loaded before calling Split '<<<<<<<<<<<<<<<<<<<<<<< IMPORTANT!!!!
' bplus modifications of Galleon fix of Bulrush Split reply #13
' http://xmaxw.[abandoned, outdated and now likely malicious qb64 dot net website - don’t go there]/forum/index.php?topic=1612.0
' this sub further developed and tested here: \test\Strings\Split test.bas
copy = mystr 'make copy since we are messing with mystr when the delimiter is a space
' >>>>>>>>>>>>>>>>> This was interferring with indentations
'special case if delim is space, probably want to remove all excess space
'IF delim = " " THEN
' copy = RTRIM$(LTRIM$(copy))
' p = INSTR(copy, " ")
' WHILE p > 0
' copy = MID$(copy, 1, p - 1) + MID$(copy, p + 1)
' p = INSTR(copy, " ")
' WEND
'END IF
curpos = 1
arrpos = 0
dpos
= INSTR(curpos
, copy
, delim
) arr
(arrpos
) = MID$(copy
, curpos
, dpos
- curpos
) arrpos = arrpos + 1
curpos = dpos + LD
dpos
= INSTR(curpos
, copy
, delim
) arr
(arrpos
) = MID$(copy
, curpos
)