RE: poke - peek Speed?

new topic     » goto parent     » topic index » view thread      » older message » newer message

> From: Don Phillips [mailto:EuNexus at yahoo.com]

> The slow up (as pointed out by Mr Craig) is this line:
> return( peek({Addr1,2}) )
> 
> I dont really understand the difference between peek({Addr1,2}) and 
> peek(Addr1) & peek(Addr1+1), they both build a sequence.  But 
> the second 
> version just about matches the results you would expect so 
> internally it 
> must be be more efficient.

It's not the return sequence, but the sequence: {Addr1,2} that's the
problem.  Rob's suggestion was to do this:

sequence peek2addr
peek2addr = {Addr1,2}

function to2bytesa(integer u)
    poke4(Addr1, u)
    return peek( peek2addr )
end function

Matt Lewis

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu