POV-Ray : Newsgroups : povray.general : Doc bug - substr() : Re: Doc bug - substr() Server Time
8 Aug 2024 06:20:06 EDT (-0400)
  Re: Doc bug - substr()  
From: Christoph Hormann
Date: 22 Feb 2001 08:55:00
Message: <3A951A2C.3DC886DE@gmx.de>
Warp wrote:
> 
>   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.
> 

But don't forget that in Pascal/Delphi it works the other way:

copy('ABCDEF', 3, 2) 

returns 'CD'.

Both ways have their advantages, i would keep it the way it is now.

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

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