![]() |
Screen attribute statement ignored on SUB exit (*solved*) - Printable Version +- Forum (https://www.boriel.com/forum) +-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11) +---- Forum: Bug Reports (https://www.boriel.com/forum/forumdisplay.php?fid=15) +---- Thread: Screen attribute statement ignored on SUB exit (*solved*) (/showthread.php?tid=1020) |
Screen attribute statement ignored on SUB exit (*solved*) - patters - 01-26-2021 If I have multiple attribute changes on a single line, the last one is ignored on exit from a SUB. Consider this example which exposes the problem: Code: SUB screenAttributes For the first example print, it should be bright but it isn't. The second example print should have red ink but it doesn't. I thought I was going mad until I found this. If I substitute another command in this last statement position of the SUB (like a PRINT for instance) then that works. It's only attribute assignments that seem to fail. Also, if I insert another command before the END SUB, then it all works as expected. e.g. the below code works fine: Code: SUB screenAttributes On further testing, the issue is not related to multiple colon-separated statements on the same line. With the following code the compiler also loses the last statement in each Sub and fails to work as expected: Code: SUB screenAttributes RE: Screen attribute statement ignored on SUB exit - boriel - 01-26-2021 (01-26-2021, 12:22 PM)patters Wrote: If I have multiple attribute changes on a single line, the last one is ignored on exit from a SUB. What version are you using? (zxbc --version) RE: Screen attribute statement ignored on SUB exit - patters - 01-26-2021 1.14.1-beta8 - the one you made with the INPUT changes to allow the system pip sound. RE: Screen attribute statement ignored on SUB exit - patters - 01-27-2021 I can confirm the same issue exists in the 1.14.1 release version. RE: Screen attribute statement ignored on SUB exit - boriel - 01-27-2021 (01-27-2021, 09:06 AM)patters Wrote: I can confirm the same issue exists in the 1.14.1 release version. Try this beta, and tell me please: http://www.boriel.com/files/zxb/zxbasic-1.15.0-beta4.tar.gz http://www.boriel.com/files/zxb/zxbasic-1.15.0-beta4.zip http://www.boriel.com/files/zxb/zxbasic-1.15.0-beta4-win32.zip http://www.boriel.com/files/zxb/zxbasic-1.15.0-beta4-linux64.tar.gz http://www.boriel.com/files/zxb/zxbasic-1.15.0-beta4-macos.tar.gz RE: Screen attribute statement ignored on SUB exit - patters - 01-28-2021 Thanks, that certainly fixes the test case above ![]() |