mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-07 09:30:15 +00:00
Change line end detection
- use color bit 7 instead of the CR char to mark the end of a help line
This commit is contained in:
parent
b3044016f7
commit
6399068293
2 changed files with 20 additions and 22 deletions
|
@ -2376,7 +2376,7 @@ FUNCTION ide2 (ignore)
|
||||||
x = l
|
x = l
|
||||||
x3 = 1
|
x3 = 1
|
||||||
c = ASC(Help_Txt$, x)
|
c = ASC(Help_Txt$, x)
|
||||||
DO UNTIL c = 13
|
DO UNTIL ASC(Help_Txt$, x + 1) > 127
|
||||||
IF Help_Select = 2 THEN
|
IF Help_Select = 2 THEN
|
||||||
IF y >= Help_SelY1 AND y <= Help_SelY2 THEN
|
IF y >= Help_SelY1 AND y <= Help_SelY2 THEN
|
||||||
IF x3 >= Help_SelX1 AND x3 <= Help_SelX2 THEN
|
IF x3 >= Help_SelX1 AND x3 <= Help_SelX2 THEN
|
||||||
|
@ -2464,7 +2464,7 @@ FUNCTION ide2 (ignore)
|
||||||
x = l
|
x = l
|
||||||
a$ = ""
|
a$ = ""
|
||||||
c = ASC(Help_Txt$, x)
|
c = ASC(Help_Txt$, x)
|
||||||
DO UNTIL c = 13
|
DO UNTIL ASC(Help_Txt$, x + 1) > 127
|
||||||
lnk = CVI(MID$(Help_Txt$, x + 2, 2))
|
lnk = CVI(MID$(Help_Txt$, x + 2, 2))
|
||||||
IF lnk THEN a$ = a$ + CHR$(c) ELSE a$ = a$ + CHR$(0) 'only add text with links
|
IF lnk THEN a$ = a$ + CHR$(c) ELSE a$ = a$ + CHR$(0) 'only add text with links
|
||||||
x = x + 4: c = ASC(Help_Txt$, x)
|
x = x + 4: c = ASC(Help_Txt$, x)
|
||||||
|
@ -2485,7 +2485,7 @@ FUNCTION ide2 (ignore)
|
||||||
c = ASC(Help_Txt$, x)
|
c = ASC(Help_Txt$, x)
|
||||||
oldlnk = 0
|
oldlnk = 0
|
||||||
lnkx1 = 0: lnkx2 = 0
|
lnkx1 = 0: lnkx2 = 0
|
||||||
DO UNTIL c = 13
|
DO UNTIL ASC(Help_Txt$, x + 1) > 127
|
||||||
lnk = CVI(MID$(Help_Txt$, x + 2, 2))
|
lnk = CVI(MID$(Help_Txt$, x + 2, 2))
|
||||||
IF lnkx1 = 0 AND lnk <> 0 AND oldlnk = 0 AND px = x2 THEN lnkx1 = x2
|
IF lnkx1 = 0 AND lnk <> 0 AND oldlnk = 0 AND px = x2 THEN lnkx1 = x2
|
||||||
IF lnkx1 <> 0 AND lnk = 0 AND lnkx2 = 0 THEN lnkx2 = x2 - 1
|
IF lnkx1 <> 0 AND lnk = 0 AND lnkx2 = 0 THEN lnkx2 = x2 - 1
|
||||||
|
@ -2597,7 +2597,7 @@ FUNCTION ide2 (ignore)
|
||||||
x = l
|
x = l
|
||||||
x2 = 1
|
x2 = 1
|
||||||
c = ASC(Help_Txt$, x)
|
c = ASC(Help_Txt$, x)
|
||||||
DO UNTIL c = 13
|
DO UNTIL ASC(Help_Txt$, x + 1) > 127
|
||||||
|
|
||||||
IF x2 = Help_cx THEN
|
IF x2 = Help_cx THEN
|
||||||
lnk = CVI(MID$(Help_Txt$, x + 2, 2))
|
lnk = CVI(MID$(Help_Txt$, x + 2, 2))
|
||||||
|
@ -17723,7 +17723,7 @@ SUB Help_ShowText
|
||||||
sx = Help_wx1
|
sx = Help_wx1
|
||||||
c = ASC(Help_Txt$, x): col = ASC(Help_Txt$, x + 1)
|
c = ASC(Help_Txt$, x): col = ASC(Help_Txt$, x + 1)
|
||||||
LOCATE sy, sx
|
LOCATE sy, sx
|
||||||
DO UNTIL c = 13
|
DO UNTIL col > 127
|
||||||
COLOR col AND 15, col \ 16
|
COLOR col AND 15, col \ 16
|
||||||
IF IdeSystem = 3 AND Help_Select = 2 THEN
|
IF IdeSystem = 3 AND Help_Select = 2 THEN
|
||||||
IF y >= Help_SelY1 AND y <= Help_SelY2 THEN
|
IF y >= Help_SelY1 AND y <= Help_SelY2 THEN
|
||||||
|
@ -17744,8 +17744,7 @@ SUB Help_ShowText
|
||||||
Help_LineLen(y - Help_sy) = x3 - 1
|
Help_LineLen(y - Help_sy) = x3 - 1
|
||||||
|
|
||||||
FOR x4 = 1 TO Help_wx2 - POS(0) + 1
|
FOR x4 = 1 TO Help_wx2 - POS(0) + 1
|
||||||
IF col = 0 THEN col = 7
|
COLOR 7, (col - 128) \ 16
|
||||||
COLOR col AND 15, col \ 16
|
|
||||||
IF IdeSystem = 3 AND Help_Select = 2 THEN
|
IF IdeSystem = 3 AND Help_Select = 2 THEN
|
||||||
IF y >= Help_SelY1 AND y <= Help_SelY2 THEN
|
IF y >= Help_SelY1 AND y <= Help_SelY2 THEN
|
||||||
IF x3 >= Help_SelX1 AND x3 <= Help_SelX2 THEN
|
IF x3 >= Help_SelX1 AND x3 <= Help_SelX2 THEN
|
||||||
|
|
|
@ -104,7 +104,6 @@ END FUNCTION
|
||||||
|
|
||||||
SUB Help_AddTxt (t$, col, link) 'Add help text, handle word wrap
|
SUB Help_AddTxt (t$, col, link) 'Add help text, handle word wrap
|
||||||
IF t$ = "" THEN EXIT SUB
|
IF t$ = "" THEN EXIT SUB
|
||||||
IF t$ = CHR$(13) THEN Help_NewLine: EXIT SUB
|
|
||||||
IF Help_ChkBlank <> 0 THEN Help_CheckBlankLine: Help_ChkBlank = 0
|
IF Help_ChkBlank <> 0 THEN Help_CheckBlankLine: Help_ChkBlank = 0
|
||||||
|
|
||||||
FOR i = 1 TO LEN(t$)
|
FOR i = 1 TO LEN(t$)
|
||||||
|
@ -155,7 +154,7 @@ SUB Help_NewLine 'Start a new help line, apply indention (if any)
|
||||||
IF Help_Pos > help_w THEN help_w = Help_Pos
|
IF Help_Pos > help_w THEN help_w = Help_Pos
|
||||||
|
|
||||||
Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = 13
|
Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = 13
|
||||||
Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = Help_BG_Col * 16
|
Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = 128 + (Help_BG_Col * 16)
|
||||||
Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = 0
|
Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = 0
|
||||||
Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = 0
|
Help_Txt_Len = Help_Txt_Len + 1: ASC(Help_Txt$, Help_Txt_Len) = 0
|
||||||
|
|
||||||
|
@ -189,20 +188,20 @@ END SUB
|
||||||
|
|
||||||
SUB Help_CheckFinishLine 'Make sure the current help line is finished
|
SUB Help_CheckFinishLine 'Make sure the current help line is finished
|
||||||
IF Help_Txt_Len >= 4 THEN
|
IF Help_Txt_Len >= 4 THEN
|
||||||
IF ASC(Help_Txt$, Help_Txt_Len - 3) <> 13 THEN Help_NewLine
|
IF ASC(Help_Txt$, Help_Txt_Len - 2) < 128 THEN Help_NewLine
|
||||||
END IF
|
END IF
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
SUB Help_CheckBlankLine 'Make sure the last help line is a blank line (implies finish current)
|
SUB Help_CheckBlankLine 'Make sure the last help line is a blank line (implies finish current)
|
||||||
IF Help_Txt_Len >= 8 THEN
|
IF Help_Txt_Len >= 8 THEN
|
||||||
IF ASC(Help_Txt$, Help_Txt_Len - 3) <> 13 THEN Help_NewLine
|
IF ASC(Help_Txt$, Help_Txt_Len - 2) < 128 THEN Help_NewLine
|
||||||
IF ASC(Help_Txt$, Help_Txt_Len - 7) <> 13 THEN Help_NewLine
|
IF ASC(Help_Txt$, Help_Txt_Len - 6) < 128 THEN Help_NewLine
|
||||||
END IF
|
END IF
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
SUB Help_CheckRemoveBlankLine 'If the last help line is blank, then remove it
|
SUB Help_CheckRemoveBlankLine 'If the last help line is blank, then remove it
|
||||||
IF Help_Txt_Len >= 8 THEN
|
IF Help_Txt_Len >= 8 THEN
|
||||||
IF ASC(Help_Txt$, Help_Txt_Len - 3) = 13 THEN
|
IF ASC(Help_Txt$, Help_Txt_Len - 2) > 127 THEN
|
||||||
Help_Txt_Len = Help_Txt_Len - 4
|
Help_Txt_Len = Help_Txt_Len - 4
|
||||||
help_h = help_h - 1
|
help_h = help_h - 1
|
||||||
Help_Line$ = LEFT$(Help_Line$, LEN(Help_Line$) - 4)
|
Help_Line$ = LEFT$(Help_Line$, LEN(Help_Line$) - 4)
|
||||||
|
@ -212,7 +211,7 @@ SUB Help_CheckRemoveBlankLine 'If the last help line is blank, then remove it
|
||||||
Help_Txt_Len = i + 3: EXIT FOR
|
Help_Txt_Len = i + 3: EXIT FOR
|
||||||
END IF
|
END IF
|
||||||
NEXT
|
NEXT
|
||||||
IF ASC(Help_Txt$, Help_Txt_Len - 3) <> 13 THEN Help_NewLine
|
IF ASC(Help_Txt$, Help_Txt_Len - 2) < 128 THEN Help_NewLine
|
||||||
END IF
|
END IF
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
|
@ -737,11 +736,11 @@ SUB WikiParse (a$) 'Wiki page interpret
|
||||||
FOR ii = Help_Txt_Len - 3 TO 1 STEP -4
|
FOR ii = Help_Txt_Len - 3 TO 1 STEP -4
|
||||||
IF ASC(Help_Txt$, ii) = 32 AND iii < 0 THEN
|
IF ASC(Help_Txt$, ii) = 32 AND iii < 0 THEN
|
||||||
Help_Pos = Help_Pos - 1
|
Help_Pos = Help_Pos - 1
|
||||||
ELSEIF ASC(Help_Txt$, ii) = 13 AND iii < 0 THEN
|
ELSEIF ASC(Help_Txt$, ii + 1) > 127 AND iii < 0 THEN
|
||||||
help_h = help_h - 1: Help_Line$ = LEFT$(Help_Line$, LEN(Help_Line$) - 4)
|
help_h = help_h - 1: Help_Line$ = LEFT$(Help_Line$, LEN(Help_Line$) - 4)
|
||||||
ELSEIF ASC(Help_Txt$, ii) = 196 AND iii < 0 THEN
|
ELSEIF ASC(Help_Txt$, ii) = 196 AND iii < 0 THEN
|
||||||
iii = -iii
|
iii = -iii
|
||||||
ELSEIF ASC(Help_Txt$, ii) = 13 AND iii > 0 THEN
|
ELSEIF ASC(Help_Txt$, ii + 1) > 127 AND iii > 0 THEN
|
||||||
Help_Txt_Len = ii + 3: EXIT FOR
|
Help_Txt_Len = ii + 3: EXIT FOR
|
||||||
END IF
|
END IF
|
||||||
NEXT
|
NEXT
|
||||||
|
@ -921,13 +920,13 @@ SUB WikiParse (a$) 'Wiki page interpret
|
||||||
|
|
||||||
IF Help_LockParse > -2 THEN 'everywhere except in fixed blocks
|
IF Help_LockParse > -2 THEN 'everywhere except in fixed blocks
|
||||||
IF Help_Txt_Len >= 8 THEN 'allow max. one blank line (ie. collapse multi blanks to just one)
|
IF Help_Txt_Len >= 8 THEN 'allow max. one blank line (ie. collapse multi blanks to just one)
|
||||||
IF ASC(Help_Txt$, Help_Txt_Len - 3) = 13 AND ASC(Help_Txt$, Help_Txt_Len - 7) = 13 THEN
|
IF ASC(Help_Txt$, Help_Txt_Len - 2) > 127 AND ASC(Help_Txt$, Help_Txt_Len - 6) > 127 THEN
|
||||||
IF Help_Center > 0 THEN Help_CIndent$ = MID$(Help_CIndent$, 2) 'drop respective center indent
|
IF Help_Center > 0 THEN Help_CIndent$ = MID$(Help_CIndent$, 2) 'drop respective center indent
|
||||||
GOTO skipMultiBlanks
|
GOTO skipMultiBlanks
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
Help_AddTxt CHR$(13), col, 0
|
Help_NewLine
|
||||||
|
|
||||||
skipMultiBlanks:
|
skipMultiBlanks:
|
||||||
IF Help_LockParse <> 0 THEN 'in all blocks reset styles at EOL
|
IF Help_LockParse <> 0 THEN 'in all blocks reset styles at EOL
|
||||||
|
@ -991,8 +990,8 @@ SUB WikiParse (a$) 'Wiki page interpret
|
||||||
FOR i = 17 TO LEN(Help_Line$) STEP 4: MID$(Help_Line$, i, 4) = MKL$(CVL(MID$(Help_Line$, i, 4)) + dtl): NEXT
|
FOR i = 17 TO LEN(Help_Line$) STEP 4: MID$(Help_Line$, i, 4) = MKL$(CVL(MID$(Help_Line$, i, 4)) + dtl): NEXT
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
'Trim Help_Txt$
|
'Finish and Trim Help_Txt$
|
||||||
Help_Txt$ = LEFT$(Help_Txt$, Help_Txt_Len) + CHR$(13) 'chr13 stops reads past end of content
|
Help_CheckFinishLine: Help_Txt$ = LEFT$(Help_Txt$, Help_Txt_Len)
|
||||||
|
|
||||||
IF Help_PageLoaded$ = "Keyword Reference - Alphabetical" THEN
|
IF Help_PageLoaded$ = "Keyword Reference - Alphabetical" THEN
|
||||||
|
|
||||||
|
@ -1007,11 +1006,11 @@ SUB WikiParse (a$) 'Wiki page interpret
|
||||||
c = ASC(Help_Txt$, x)
|
c = ASC(Help_Txt$, x)
|
||||||
oldlnk = 0
|
oldlnk = 0
|
||||||
lnkx1 = 0: lnkx2 = 0
|
lnkx1 = 0: lnkx2 = 0
|
||||||
DO UNTIL c = 13
|
DO UNTIL ASC(Help_Txt$, x + 1) > 127
|
||||||
ASC(a$, x2) = c
|
ASC(a$, x2) = c
|
||||||
lnk = CVI(MID$(Help_Txt$, x + 2, 2))
|
lnk = CVI(MID$(Help_Txt$, x + 2, 2))
|
||||||
IF oldlnk = 0 AND lnk <> 0 THEN lnkx1 = x2
|
IF oldlnk = 0 AND lnk <> 0 THEN lnkx1 = x2
|
||||||
IF (lnk = 0 OR ASC(Help_Txt$, x + 4) = 13) AND lnkx1 <> 0 THEN
|
IF (lnk = 0 OR ASC(Help_Txt$, x + 5) > 127) AND lnkx1 <> 0 THEN
|
||||||
lnkx2 = x2: IF lnk = 0 THEN lnkx2 = lnkx2 - 1
|
lnkx2 = x2: IF lnk = 0 THEN lnkx2 = lnkx2 - 1
|
||||||
|
|
||||||
IF lnkx1 <> 3 THEN GOTO ignorelink
|
IF lnkx1 <> 3 THEN GOTO ignorelink
|
||||||
|
|
Loading…
Reference in a new issue