POV-Ray : Newsgroups : povray.general : Doc bug - substr() : Re: Doc bug - substr() Server Time
8 Aug 2024 06:14:43 EDT (-0400)
  Re: Doc bug - substr()  
From: Bob H 
Date: 22 Feb 2001 08:11:19
Message: <3a950ff7@news.povray.org>
Position 1 might be a good way of saying first character of a string though,
since it isn't a completely numerical thing being dealt with.
substr("abcd",1,1) being "a", instead of substr("abcd",0,0), just looks more
correct in this context to me.
Why isn't there a strlen() in the documentation?  :-)

Bob H.

"Warp" <war### [at] tagpovrayorg> wrote in message
news:3a94e885@news.povray.org...
>   It seems that the one who wrote that part of the doc thought that the
> indexing starts from 0 and ends at strlen(S)-1, as in C.
>
>   Perhaps the problem is not in the documentation, but in povray. In my
> opinion this behaviour is a bit inconsistent. Array indexing starts from
0.
>
> --
> char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
> main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
> c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););}    /*- Warp -*/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.