Re: Supercharge your peek_string()

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

Al,
I've incorporated your peek_string idea into win32lib. Thanks for the idea.

It works fast because I suspect it's written in optimized assembler.

I have no idea what Matt is on about. These strings are just byte arrays
that are terminated with a #00 byte.

Just try this experiment...

  atom addr
  integer len1, len2

  addr = allocate(100)

  poke(addr, "abcdefghijklmnopqrstuvwxyz" & 0)

  len1 = c_func(xlstrlen, {addr})
  len2 = c_func(xlstrlen, {addr + 1})

  -- len2 --> 25
  -- len1 --> 26


------
Derek Parnell
Melbourne, Australia
"To finish a job quickly, go slower."

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

Search



Quick Links

User menu

Not signed in.

Misc Menu