From 731e9cd0df03f4039fff998b3aeb4e26fd6f805d Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Sun, 14 Feb 2021 00:53:14 -0300 Subject: [PATCH] Fixes low ASCII characters showing up in Warnings box. --- source/ide/ide_methods.bas | 20 ++++++-------------- source/qb64.bas | 29 +++++++++++++++++++++++------ 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/source/ide/ide_methods.bas b/source/ide/ide_methods.bas index e07031762..fb9dee229 100644 --- a/source/ide/ide_methods.bas +++ b/source/ide/ide_methods.bas @@ -9231,22 +9231,14 @@ FUNCTION idewarningbox '-------- 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$ maxModuleNameLen = LEN(thisprog$) - 'fill arrays + 'calculate longest module name FOR x = 1 TO warningListItems - warningLines(x) = CVL(LEFT$(warning$(x), 4)) IF warningLines(x) = 0 THEN _CONTINUE - warningIncLevel = CVL(MID$(warning$(x), 5, 4)) - 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 warningIncLines(x) > 0 THEN IF LEN(warningIncFiles(x)) > maxModuleNameLen THEN maxModuleNameLen = LEN(warningIncFiles(x)) END IF @@ -9256,21 +9248,21 @@ FUNCTION idewarningbox 'build list FOR x = 1 TO warningListItems 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 ELSE l3$ = CHR$(16) + CHR$(2) 'dark grey IF warningIncLines(x) > 0 THEN - num$ = SPACE$(maxLineNumberLength) + num$ = SPACE$(LEN(STR$(maxLineNumber)) + 1) RSET num$ = str2$(warningIncLines(x)) l3$ = l3$ + warningIncFiles(x) + SPACE$(maxModuleNameLen - LEN(warningIncFiles(x))) + ":" + CHR$(16) + CHR$(16) + num$ ELSE - num$ = SPACE$(maxLineNumberLength) + num$ = SPACE$(LEN(STR$(maxLineNumber)) + 1) RSET num$ = str2$(warningLines(x)) l3$ = l3$ + thisprog$ + SPACE$(maxModuleNameLen - LEN(thisprog$)) + ":" + CHR$(16) + CHR$(16) + num$ END IF treeConnection = LEN(l$) + 1 - text$ = MID$(warning$(x), INSTR(warning$(x), CHR$(255)) + 1) + text$ = warning$(x) IF LEN(text$) THEN l$ = l$ + CHR$(195) + CHR$(196) + l3$ + ": " + text$ ELSE diff --git a/source/qb64.bas b/source/qb64.bas index 64e0dd3ec..3b5797f1b 100644 --- a/source/qb64.bas +++ b/source/qb64.bas @@ -110,7 +110,7 @@ REDIM SHARED usedVariableList(1000) AS usedVarList, totalVariablesCreated AS LON DIM SHARED bypassNextVariable AS _BYTE DIM SHARED totalWarnings AS LONG, warningListItems AS LONG, lastWarningHeader AS STRING 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 VersionInfoSet AS _BYTE @@ -1094,7 +1094,9 @@ ideerror: IF INSTR(idemessage$, sp$) THEN '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) - 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 _ERRORLINE THEN idemessage$ = idemessage$ + str2$(_ERRORLINE) IF _INCLERRORLINE THEN idemessage$ = idemessage$ + "-" + _INCLERRORFILE$ + "-" + str2$(_INCLERRORLINE) @@ -1419,6 +1421,10 @@ emptySCWarning = 0 warningListItems = 0 lastWarningHeader = "" 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 qb64prefix_set = 0 qb64prefix$ = "_" @@ -25458,26 +25464,37 @@ SUB addWarning (whichLineNumber AS LONG, includeLevel AS LONG, incLineNumber AS END IF ELSEIF idemode THEN IF NOT IgnoreWarnings THEN + IF whichLineNumber > maxLineNumber THEN maxLineNumber = whichLineNumber IF lastWarningHeader <> header$ THEN lastWarningHeader = header$ GOSUB increaseWarningCount - warning$(warningListItems) = MKL$(0) + CHR$(255) + header$ + warning$(warningListItems) = header$ + warningLines(warningListItems) = 0 END IF GOSUB increaseWarningCount + warning$(warningListItems) = text$ + warningLines(warningListItems) = whichLineNumber IF includeLevel > 0 THEN thisincname$ = getfilepath$(incFileName$) 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 - warning$(warningListItems) = MKL$(whichLineNumber) + MKL$(0) + CHR$(255) + text$ + warningIncLines(warningListItems) = 0 + warningIncFiles(warningListItems) = "" END IF END IF END IF EXIT SUB increaseWarningCount: 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 END SUB