You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
I created the following program that uses the POKE instruction but when I run it it does not change the contents of the memory location being referenced.
1 REM THIS PROGRAM IS suppose TO CHANGE THE STRING FROM " " TO "A " but doesn't
5 DEFINT A-N
6 DEFINT P-Z
10 OBJCODE$ = " "
20 OBJPTR = VARPTR(OBJCODE$)
25 OBJPTR = PEEK(OBJPTR+1) + 256*PEEK(OBJPTR+2)
30 A = 65
40 POKE OBJPTR,A
50 PRINT LEN(OBJCODE$), OBJCODE$
60 PRINT PEEK(OBJPTR+1),PEEK(OBJPTR+2),PEEK(OBJPTR+3)
After this program is run OBJCODE$ is not changed.
If i do a POKE OBJPTR,A instruction after the program is run then OBJCODE$ is not changed.
I am using PCBASIC version 2.0.2
Operating system version : Windows 7
POKEing to change the contents of variables or strings is not currently supported (though read access with PEEK is supported). It may be added in a future version.
Activity
robhagemans commentedon Nov 30, 2019
Hi @Mrdavidyunker ,
POKEing to change the contents of variables or strings is not currently supported (though read access withPEEKis supported). It may be added in a future version.Thanks
[-]Having problem with POKE instruction[/-][+]Change string contents with POKE[/+]