Re: peek/poke
- Posted by Everett Williams <rett at GVTC.COM> Mar 27, 2000
- 632 views
On Mon, 27 Mar 2000 14:14:05 -0600, Kat <gertie at ZEBRA.NET> wrote: >I have a question too! >Since we have: >s = peek({100, 4}) >where 4 memory locations (100,101,102,103) are read and dropped into s, >where is the corresponding poke command? What if i want to poke a 80K >sequence into memory? Can i do: >poke(s,{location,length(s)}) >, where each byte of s lands in the next memory location? What if s contains >nested sequences? It's not in the docs that i can find. What if i want each >char of s to land in the *same* memory addy? > >Kat Kat, unless I have completely misread the manual, there is no length parameter in either poke or poke4. s in your equation must be an atom, not a sequence. The length of the sequence will determine the length of the poke.So, you should check the length of the available allocation from the point of the poke against the length of the sequence before you start the process. Since nothing in Euphoria that is exposed keeps track of that remaining length, it is, as usual, an exercise for the user. That is why, IMO, the examples use an offset rather than changing the address...it makes the available length more obvious. As for nesting, another exercise to be tested by the user( I really am not against an improved manual ) Everett L.(Rett) Williams rett at gvtc.com