RE: poke - peek Speed?
- Posted by Matthew Lewis <matthewwalkerlewis at YAHOO.COM> Nov 15, 2002
- 423 views
> 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