Skip to content

Change string contents with POKE #108

@Mrdavidyunker

Description

@Mrdavidyunker

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions