Boriel Basic Forum
poke string address,string$ - Printable Version

+- Boriel Basic Forum (https://forum.boriel.com)
+-- Forum: Compilers and Computer Languages (https://forum.boriel.com/forumdisplay.php?fid=12)
+--- Forum: ZX Basic Compiler (https://forum.boriel.com/forumdisplay.php?fid=11)
+---- Forum: Wishlist (https://forum.boriel.com/forumdisplay.php?fid=14)
+---- Thread: poke string address,string$ (/showthread.php?tid=591)



poke string address,string$ - programandala.net - 2014-05-21

I think POKE STRING would be useful in many situations. It would poke the content of a string (not its lenght). I've written it this way:

Code:
sub fastcall pokeString(address as uinteger,text$ as string) asm ; HL = first parameter, address ex de,hl ; DE = address pop bc ; return address pop hl ; second parameter, address of the text$ lenght push bc ; restore the return address ld c,(hl) inc hl ld b,(hl) ; BC = text$ lenght inc hl ; HL = first char of text$ ldir end asm end sub

The advantage of a native POKE STRING would be POKE would work with all current types.


Re: poke string address,string$ - programandala.net - 2014-05-24

I've just found a thread by LCD on the same subject, POKE STRING and @string$, where Boriel explains the memcopy library can be used instead.