From 796974c04ddfe076e546d764ec98ae5dbd603800 Mon Sep 17 00:00:00 2001 From: Fellippe Heitor Date: Sat, 6 Feb 2021 15:04:07 -0300 Subject: [PATCH] Adds commit number, if available, to error reports. --- source/global/version.bas | 6 +++--- source/ide/ide_methods.bas | 12 +++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/source/global/version.bas b/source/global/version.bas index d268370ab..2bbb38f8f 100644 --- a/source/global/version.bas +++ b/source/global/version.bas @@ -1,14 +1,14 @@ DIM SHARED Version AS STRING -DIM SHARED BuildNum AS STRING +DIM SHARED DevChannel AS STRING DIM SHARED AutoBuildMsg AS STRING Version$ = "1.5" -BuildNum$ = "(development build)" +DevChannel$ = "(development build)" IF _FILEEXISTS("internal/version.txt") THEN versionfile = FREEFILE OPEN "internal/version.txt" FOR INPUT AS #versionfile LINE INPUT #versionfile, AutoBuildMsg - AutoBuildMsg = _TRIM$(AutoBuildMsg) + AutoBuildMsg = LEFT$(_TRIM$(AutoBuildMsg), 16) 'From git 1234567 IF LEFT$(AutoBuildMsg, 9) <> "From git " THEN AutoBuildMsg = "" CLOSE #versionfile END IF diff --git a/source/ide/ide_methods.bas b/source/ide/ide_methods.bas index ec2adae18..80260b333 100644 --- a/source/ide/ide_methods.bas +++ b/source/ide/ide_methods.bas @@ -144,7 +144,7 @@ FUNCTION ide2 (ignore) 'report any IDE errors which have occurred IF ideerror THEN mustdisplay = 1 - IF ideerror = 1 THEN errorat$ = _ERRORMESSAGE$ + IF ideerror = 1 THEN errorat$ = "Internal IDE error" IF ideerror = 2 THEN errorat$ = "File not found" IF ideerror = 3 THEN errorat$ = "File access error": CLOSE #150 IF ideerror = 4 THEN errorat$ = "Path not found" @@ -161,7 +161,9 @@ FUNCTION ide2 (ignore) IF (ideerror > 1) THEN 'Don't show too much detail if user just tried loading an invalid file - ideerrormessageTITLE$ = ideerrormessageTITLE$ + " (" + str2$(_ERRORLINE) + "-" + str2$(_INCLERRORLINE) + ")" + ideerrormessageTITLE$ = ideerrormessageTITLE$ + " (" + str2$(_ERRORLINE) + "-" + str2$(_INCLERRORLINE) + IF LEN(AutoBuildMsg$) THEN ideerrormessageTITLE$ = ideerrormessageTITLE$ + "-" + MID$(AutoBuildMsg$, 10) + ideerrormessageTITLE$ = ideerrormessageTITLE$ + ")" IF AttemptToLoadRecent = -1 THEN 'Offer to cleanup recent file list, removing invalid entries PCOPY 2, 0 @@ -178,9 +180,9 @@ FUNCTION ide2 (ignore) IF inclerrorline THEN errorat$ = errorat$ + CHR$(10) + " " + CHR$(10) + "(module: " + _ RemoveFileExtension$(LEFT$(_INCLERRORFILE$, 60)) - errorat$ = errorat$ + ", on line: " + str2$(inclerrorline) + ")" + errorat$ = errorat$ + ", on line: " + str2$(inclerrorline) + ", " + MID$(AutoBuildMsg$, 10) + ")" ELSE - errorat$ = errorat$ + CHR$(10) + " " + CHR$(10) + "(on line: " + str2$(_ERRORLINE) + ")" + errorat$ = errorat$ + CHR$(10) + " " + CHR$(10) + "(on line: " + str2$(_ERRORLINE) + ", " + MID$(AutoBuildMsg$, 10) + ")" END IF END IF @@ -4920,7 +4922,7 @@ FUNCTION ide2 (ignore) IF menu$(m, s) = "#About..." THEN helpabout: PCOPY 2, 0 - m$ = "QB64 Version " + Version$ + CHR$(10) + BuildNum$ + m$ = "QB64 Version " + Version$ + CHR$(10) + DevChannel$ IF LEN(AutoBuildMsg$) THEN m$ = m$ + CHR$(10) + AutoBuildMsg$ result = idemessagebox("About", m$, "") PCOPY 3, 0: SCREEN , , 3, 0