Skip to content

Commit 29c4dbe

Browse files
Merge pull request QB64-Phoenix-Edition#714 from QB64-Phoenix-Edition/no_erase_spaces
Don't clear fixed length strings with spaces
2 parents 1d617a4 + cf58d8d commit 29c4dbe

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

tests/compile_tests/arrays/multiple_arrays_same_type.bas

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ TYPE MultiArrays
1111
B( - 1 To 1 , 2 To 3) AS LONG
1212
Tail AS LONG
1313
C( 0 To 1 , 0 To 1 , 0 To 1) AS _BYTE
14+
S( 2) AS STRING * 5
1415
END TYPE
1516

1617
DIM x(0) AS MultiArrays
@@ -60,6 +61,14 @@ CheckTrue "Erase member zeroes B", x(0).B(-1, 2) = 0 AND x(0).B(1, 3) = 0
6061
CheckTrue "Erase member keeps tail", x(0).Tail = 3000
6162
CheckTrue "Erase member keeps C", x(0).C(1, 1, 1) = 7
6263

64+
x ( 0 ) . S ( 0 ) = "hello"
65+
ERASE x ( 0 ) . S
66+
CheckTrue "Erase member sets fixed string to 0s", x().s(0) = STRING$(5, 0)
67+
68+
x ( 0 ) . S ( 0 ) = "hello"
69+
ERASE x
70+
CheckTrue "Erase array sets nested fixed string to 0s", x().s(0) = STRING$(5, 0)
71+
6372
FinishTest
6473
'sleep
6574
SYSTEM

0 commit comments

Comments
 (0)