Menu

#11 STRING compars in brackets results in variant error

release 0.3-beta
open
nobody
None
2026-03-09
2026-03-09
No

?"A"+"B"="AB" -> -1 (correct)
?("A"+"B"="AB") -> Variant error and the interpreter crashes

Discussion

  • Dietmar Schmidt

    Dietmar Schmidt - 2026-03-09
    • status: open --> closed
     
  • Dietmar Schmidt

    Dietmar Schmidt - 2026-03-09

    n function IsOperatorOrKeywordBefore(const HSt: string; PosBefore: Integer): Boolean;
    Zeilen hinzugefügt:

     if p<1 then
      begin
        result:=true; // links vom String, also führendes Vorzeichen
        exit;
      end;
    
     
  • Dietmar Schmidt

    Dietmar Schmidt - 2026-03-09
    • status: closed --> open
     
  • Dietmar Schmidt

    Dietmar Schmidt - 2026-03-09

    n function IsOperatorOrKeywordBefore(const HSt: string; PosBefore: Integer): Boolean;
    Zeilen hinzugefügt:

     if p<1 then
      begin
        result:=true; // links vom String, also führendes Vorzeichen
        exit;
      end;
    
     
  • Dietmar Schmidt

    Dietmar Schmidt - 2026-03-09

    das oben hat ein Leerzeichen vor einem Vorzeichen am Anfang dann richtig behandelt, aber Probleme gibt es noch bei folgenden Beispielen:

    ?1+a$="Q"
    ?"Q"="Q"+1

    und schlimmer:
    ?"Q"="Q"+i

    Wenn die Stringvergleiche in Klammern gesetzt werden wie beim Original-CPC geht es, sollte aber gefixt werden.

     

Log in to post a comment.

MongoDB Logo MongoDB