'explode' error

Q&A's, tips, howto's
Locked
Fanda
Posts: 253
Joined: Tue Aug 02, 2005 6:40 am
Contact:

'explode' error

Post by Fanda »

Hello Lutz!

Function 'explode' returns strange results when exploding strings and using numbers bigger than the length of a string:

Code: Select all

> (explode "abc" 1)
("a" "b" "c")
> (explode "abc" 2)
("ab" "c")
> (explode "abc" 3)
("abc")
> (explode "abc" 4)
("abc\000")
> (explode "abc" 5)
("abc\000\000")
> (explode "abc" 6)
("abc\000\000\002")
> (explode "abc" 7)
("abc\000\000\002=")
> (explode "abc" 8)
("abc\000\000\002=\000")
> (explode "abc" 9)
CRASH

(explode "abc" 10)
("abc\000k\000=\000\130\000")
Exploding lists works ok.

Fanda

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

using numbers bigger than the length of a string
thanks, I will look into it.

Lutz

Locked