From 296a46b33c5d5d47745eb3892172295c83851bb5 Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Sat, 11 Sep 2021 00:52:28 -0300 Subject: [PATCH] Fixes `PUT` with variable-length strings in UDTs. Closes #133 --- source/qb64.bas | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/qb64.bas b/source/qb64.bas index b2d78418c..7849efddf 100644 --- a/source/qb64.bas +++ b/source/qb64.bas @@ -18028,6 +18028,11 @@ FUNCTION evaluatetotyp$ (a2$, targettyp AS LONG) IF (udtetype(E) AND ISSTRING) > 0 AND (udtetype(E) AND ISFIXEDLENGTH) = 0 AND (targettyp = -5) THEN evaluatetotyp$ = "(*(qbs**)" + dst$ + ")->len" EXIT FUNCTION + ELSEIF (udtetype(E) AND ISSTRING) > 0 AND (udtetype(E) AND ISFIXEDLENGTH) = 0 AND (targettyp = -4) THEN + dst$ = "(*((qbs**)((char*)" + scope$ + n$ + "+(" + o$ + "))))->chr" + bytes$ = "(*((qbs**)((char*)" + scope$ + n$ + "+(" + o$ + "))))->len" + evaluatetotyp$ = "byte_element((uint64)" + dst$ + "," + bytes$ + "," + NewByteElement$ + ")" + EXIT FUNCTION END IF bytes$ = str2(udtesize(E) \ 8) END IF