From 9d08c78dfccb54c8a54819b83d20bf00beaccf87 Mon Sep 17 00:00:00 2001 From: Fellippe Heitor Date: Thu, 27 May 2021 20:08:45 -0300 Subject: [PATCH] Prevent errors with literal string Consts --- source/qb64.bas | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/source/qb64.bas b/source/qb64.bas index 3ec20c38d..62a605dc3 100644 --- a/source/qb64.bas +++ b/source/qb64.bas @@ -2119,13 +2119,16 @@ DO NEXT 'intercept current expression and pass it through Evaluate_Expression$ - temp1$ = _TRIM$(Evaluate_Expression$(readable_e$)) - IF LEFT$(temp1$, 5) <> "ERROR" AND e$ <> temp1$ THEN - e$ = lineformat(temp1$) 'retrieve parseable format - ELSE - IF temp1$ = "ERROR - Division By Zero" THEN a$ = temp1$: GOTO errmes - IF INSTR(temp1$, "Improper operations") THEN - a$ = "Invalid CONST expression.14": GOTO errmes + '(unless it is a literal string) + IF LEFT$(readable_e$, 1) <> CHR$(34) THEN + temp1$ = _TRIM$(Evaluate_Expression$(readable_e$)) + IF LEFT$(temp1$, 5) <> "ERROR" AND e$ <> temp1$ THEN + e$ = lineformat(temp1$) 'retrieve parseable format + ELSE + IF temp1$ = "ERROR - Division By Zero" THEN a$ = temp1$: GOTO errmes + IF INSTR(temp1$, "Improper operations") THEN + a$ = "Invalid CONST expression.14": GOTO errmes + END IF END IF END IF