mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-06-29 09:20:38 +00:00
Fixes low ASCII characters showing up in Warnings box.
This commit is contained in:
parent
7f4360f7da
commit
731e9cd0df
|
@ -9231,22 +9231,14 @@ FUNCTION idewarningbox
|
||||||
|
|
||||||
'-------- init --------
|
'-------- init --------
|
||||||
|
|
||||||
DIM warningLines(1 TO warningListItems) AS LONG
|
|
||||||
DIM warningIncLines(1 TO warningListItems) AS LONG
|
|
||||||
DIM warningIncFiles(1 TO warningListItems) AS STRING
|
|
||||||
|
|
||||||
IF LEN(ideprogname) THEN thisprog$ = ideprogname ELSE thisprog$ = "Untitled" + tempfolderindexstr$
|
IF LEN(ideprogname) THEN thisprog$ = ideprogname ELSE thisprog$ = "Untitled" + tempfolderindexstr$
|
||||||
maxModuleNameLen = LEN(thisprog$)
|
maxModuleNameLen = LEN(thisprog$)
|
||||||
|
|
||||||
'fill arrays
|
'calculate longest module name
|
||||||
FOR x = 1 TO warningListItems
|
FOR x = 1 TO warningListItems
|
||||||
warningLines(x) = CVL(LEFT$(warning$(x), 4))
|
|
||||||
IF warningLines(x) = 0 THEN _CONTINUE
|
IF warningLines(x) = 0 THEN _CONTINUE
|
||||||
|
|
||||||
warningIncLevel = CVL(MID$(warning$(x), 5, 4))
|
IF warningIncLines(x) > 0 THEN
|
||||||
IF warningIncLevel > 0 THEN
|
|
||||||
warningIncLines(x) = CVL(MID$(warning$(x), 9, 4))
|
|
||||||
warningIncFiles(x) = MID$(warning$(x), 13, INSTR(warning$(x), CHR$(255)) - 13)
|
|
||||||
IF LEN(warningIncFiles(x)) > maxModuleNameLen THEN
|
IF LEN(warningIncFiles(x)) > maxModuleNameLen THEN
|
||||||
maxModuleNameLen = LEN(warningIncFiles(x))
|
maxModuleNameLen = LEN(warningIncFiles(x))
|
||||||
END IF
|
END IF
|
||||||
|
@ -9256,21 +9248,21 @@ FUNCTION idewarningbox
|
||||||
'build list
|
'build list
|
||||||
FOR x = 1 TO warningListItems
|
FOR x = 1 TO warningListItems
|
||||||
IF warningLines(x) = 0 THEN
|
IF warningLines(x) = 0 THEN
|
||||||
l$ = l$ + MID$(warning$(x), INSTR(warning$(x), CHR$(255)) + 1)
|
l$ = l$ + warning$(x)
|
||||||
IF x > 1 THEN ASC(l$, treeConnection) = 192
|
IF x > 1 THEN ASC(l$, treeConnection) = 192
|
||||||
ELSE
|
ELSE
|
||||||
l3$ = CHR$(16) + CHR$(2) 'dark grey
|
l3$ = CHR$(16) + CHR$(2) 'dark grey
|
||||||
IF warningIncLines(x) > 0 THEN
|
IF warningIncLines(x) > 0 THEN
|
||||||
num$ = SPACE$(maxLineNumberLength)
|
num$ = SPACE$(LEN(STR$(maxLineNumber)) + 1)
|
||||||
RSET num$ = str2$(warningIncLines(x))
|
RSET num$ = str2$(warningIncLines(x))
|
||||||
l3$ = l3$ + warningIncFiles(x) + SPACE$(maxModuleNameLen - LEN(warningIncFiles(x))) + ":" + CHR$(16) + CHR$(16) + num$
|
l3$ = l3$ + warningIncFiles(x) + SPACE$(maxModuleNameLen - LEN(warningIncFiles(x))) + ":" + CHR$(16) + CHR$(16) + num$
|
||||||
ELSE
|
ELSE
|
||||||
num$ = SPACE$(maxLineNumberLength)
|
num$ = SPACE$(LEN(STR$(maxLineNumber)) + 1)
|
||||||
RSET num$ = str2$(warningLines(x))
|
RSET num$ = str2$(warningLines(x))
|
||||||
l3$ = l3$ + thisprog$ + SPACE$(maxModuleNameLen - LEN(thisprog$)) + ":" + CHR$(16) + CHR$(16) + num$
|
l3$ = l3$ + thisprog$ + SPACE$(maxModuleNameLen - LEN(thisprog$)) + ":" + CHR$(16) + CHR$(16) + num$
|
||||||
END IF
|
END IF
|
||||||
treeConnection = LEN(l$) + 1
|
treeConnection = LEN(l$) + 1
|
||||||
text$ = MID$(warning$(x), INSTR(warning$(x), CHR$(255)) + 1)
|
text$ = warning$(x)
|
||||||
IF LEN(text$) THEN
|
IF LEN(text$) THEN
|
||||||
l$ = l$ + CHR$(195) + CHR$(196) + l3$ + ": " + text$
|
l$ = l$ + CHR$(195) + CHR$(196) + l3$ + ": " + text$
|
||||||
ELSE
|
ELSE
|
||||||
|
|
|
@ -110,7 +110,7 @@ REDIM SHARED usedVariableList(1000) AS usedVarList, totalVariablesCreated AS LON
|
||||||
DIM SHARED bypassNextVariable AS _BYTE
|
DIM SHARED bypassNextVariable AS _BYTE
|
||||||
DIM SHARED totalWarnings AS LONG, warningListItems AS LONG, lastWarningHeader AS STRING
|
DIM SHARED totalWarnings AS LONG, warningListItems AS LONG, lastWarningHeader AS STRING
|
||||||
DIM SHARED duplicateConstWarning AS _BYTE, warningsissued AS _BYTE
|
DIM SHARED duplicateConstWarning AS _BYTE, warningsissued AS _BYTE
|
||||||
DIM SHARED emptySCWarning AS _BYTE
|
DIM SHARED emptySCWarning AS _BYTE, maxLineNumber AS LONG
|
||||||
DIM SHARED ExeIconSet AS LONG, qb64prefix$, qb64prefix_set
|
DIM SHARED ExeIconSet AS LONG, qb64prefix$, qb64prefix_set
|
||||||
DIM SHARED VersionInfoSet AS _BYTE
|
DIM SHARED VersionInfoSet AS _BYTE
|
||||||
|
|
||||||
|
@ -1094,7 +1094,9 @@ ideerror:
|
||||||
IF INSTR(idemessage$, sp$) THEN
|
IF INSTR(idemessage$, sp$) THEN
|
||||||
'Something went wrong here, so let's give a generic error message to the user.
|
'Something went wrong here, so let's give a generic error message to the user.
|
||||||
'(No error message should contain sp$ - that is, CHR$(13), when not in Debug mode)
|
'(No error message should contain sp$ - that is, CHR$(13), when not in Debug mode)
|
||||||
idemessage$ = "Compiler error (check for syntax errors) (" + _ERRORMESSAGE$ + ":"
|
terrmsg$ = _ERRORMESSAGE$
|
||||||
|
IF terrmsg$ = "No error" THEN terrmsg$ = "Internal error"
|
||||||
|
idemessage$ = "Compiler error (check for syntax errors) (" + terrmsg$ + ":"
|
||||||
IF ERR THEN idemessage$ = idemessage$ + str2$(ERR) + "-"
|
IF ERR THEN idemessage$ = idemessage$ + str2$(ERR) + "-"
|
||||||
IF _ERRORLINE THEN idemessage$ = idemessage$ + str2$(_ERRORLINE)
|
IF _ERRORLINE THEN idemessage$ = idemessage$ + str2$(_ERRORLINE)
|
||||||
IF _INCLERRORLINE THEN idemessage$ = idemessage$ + "-" + _INCLERRORFILE$ + "-" + str2$(_INCLERRORLINE)
|
IF _INCLERRORLINE THEN idemessage$ = idemessage$ + "-" + _INCLERRORFILE$ + "-" + str2$(_INCLERRORLINE)
|
||||||
|
@ -1419,6 +1421,10 @@ emptySCWarning = 0
|
||||||
warningListItems = 0
|
warningListItems = 0
|
||||||
lastWarningHeader = ""
|
lastWarningHeader = ""
|
||||||
REDIM SHARED warning$(1000)
|
REDIM SHARED warning$(1000)
|
||||||
|
REDIM SHARED warningLines(1000) AS LONG
|
||||||
|
REDIM SHARED warningIncLines(1000) AS LONG
|
||||||
|
REDIM SHARED warningIncFiles(1000) AS STRING
|
||||||
|
maxLineNumber = 0
|
||||||
uniquenumbern = 0
|
uniquenumbern = 0
|
||||||
qb64prefix_set = 0
|
qb64prefix_set = 0
|
||||||
qb64prefix$ = "_"
|
qb64prefix$ = "_"
|
||||||
|
@ -25458,26 +25464,37 @@ SUB addWarning (whichLineNumber AS LONG, includeLevel AS LONG, incLineNumber AS
|
||||||
END IF
|
END IF
|
||||||
ELSEIF idemode THEN
|
ELSEIF idemode THEN
|
||||||
IF NOT IgnoreWarnings THEN
|
IF NOT IgnoreWarnings THEN
|
||||||
|
IF whichLineNumber > maxLineNumber THEN maxLineNumber = whichLineNumber
|
||||||
IF lastWarningHeader <> header$ THEN
|
IF lastWarningHeader <> header$ THEN
|
||||||
lastWarningHeader = header$
|
lastWarningHeader = header$
|
||||||
GOSUB increaseWarningCount
|
GOSUB increaseWarningCount
|
||||||
warning$(warningListItems) = MKL$(0) + CHR$(255) + header$
|
warning$(warningListItems) = header$
|
||||||
|
warningLines(warningListItems) = 0
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
GOSUB increaseWarningCount
|
GOSUB increaseWarningCount
|
||||||
|
warning$(warningListItems) = text$
|
||||||
|
warningLines(warningListItems) = whichLineNumber
|
||||||
IF includeLevel > 0 THEN
|
IF includeLevel > 0 THEN
|
||||||
thisincname$ = getfilepath$(incFileName$)
|
thisincname$ = getfilepath$(incFileName$)
|
||||||
thisincname$ = MID$(incFileName$, LEN(thisincname$) + 1)
|
thisincname$ = MID$(incFileName$, LEN(thisincname$) + 1)
|
||||||
warning$(warningListItems) = MKL$(whichLineNumber) + MKL$(includeLevel) + MKL$(incLineNumber) + thisincname$ + CHR$(255) + text$
|
warningIncLines(warningListItems) = incLineNumber
|
||||||
|
warningIncFiles(warningListItems) = thisincname$
|
||||||
ELSE
|
ELSE
|
||||||
warning$(warningListItems) = MKL$(whichLineNumber) + MKL$(0) + CHR$(255) + text$
|
warningIncLines(warningListItems) = 0
|
||||||
|
warningIncFiles(warningListItems) = ""
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
increaseWarningCount:
|
increaseWarningCount:
|
||||||
warningListItems = warningListItems + 1
|
warningListItems = warningListItems + 1
|
||||||
IF warningListItems > UBOUND(warning$) THEN REDIM _PRESERVE warning$(warningListItems + 999)
|
IF warningListItems > UBOUND(warning$) THEN
|
||||||
|
REDIM _PRESERVE warning$(warningListItems + 999)
|
||||||
|
REDIM _PRESERVE warningLines(warningListItems + 999) AS LONG
|
||||||
|
REDIM _PRESERVE warningIncLines(warningListItems + 999) AS LONG
|
||||||
|
REDIM _PRESERVE warningIncFiles(warningListItems + 999) AS STRING
|
||||||
|
END IF
|
||||||
RETURN
|
RETURN
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue