POV-Ray : Newsgroups : povray.newusers : Is there a "string length" function? Server Time
31 Jul 2024 10:23:26 EDT (-0400)
  Is there a "string length" function? (Message 31 to 40 of 46)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 6 Messages >>>
From: Christopher James Huff
Subject: Re: Is there a "string length" function?
Date: 23 Feb 2003 12:04:38
Message: <cjameshuff-D57F98.12011623022003@netplex.aussie.org>
In article <3e58e425@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

> Will W <wil### [at] nospamwizzardsnet> wrote:
> > Organizing functions by return type is, for me, an intriguing idea.
> 
>   There's a very good reason for this in programming, as I explained
> previously.

This isn't programming, it's documentation. The first thing most people 
will look for when looking for a string length function is a group of 
functions for manipulating strings.


>   The type of something determines where it can be used. For example, if
> an integer is expected in a particular place, then any item of integer
> type can be used there (ie. an integer literal, an integer variable, an
> integer function or an expression which result is an integer).

The purpose determines where it is useful. strlen() is only useful when 
handling strings, it is useless for math stuff.


>   The purpose of a function (eg. to manipulate strings or whatever) is
> a higher-level concept which has nothing to do with its type. The parameters
> the function takes have nothing to do with its type (they don't affect in
> any way *where* you can use the function).

Higher-level means closer to human thinking. The documentation is meant 
to teach humans.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Christopher James Huff
Subject: Re: Is there a "string length" function?
Date: 23 Feb 2003 12:25:26
Message: <cjameshuff-33C0B1.12220423022003@netplex.aussie.org>
In article <3e58628d@news.povray.org>,
 "Will W" <wil### [at] NOSPAMwizzardsnet> wrote:

> An added section of cross references for those who come to POV from a
> programming background could be very helpful. If there was a section
> entitled "Especially for Programmers New To POV" I would have read that
> before any other part of the manual, and I think that would be true for any
> other programmer, too. That would be a good place to say that in the SDL
> philosophy functions are organized by their return type, describe how POV
> macros differ from keyboard macros and subroutine calls, and so on. Such
> material should not replace what has been written, but should be added as an
> appendix.

It would be nice if it could be done without making the reader jump all 
over the documentation, but without much duplication. Here's one 
possible layout:

numeric functions
    scalar functions (float and integer)
        trig sub group...trig functions should be together, not mixed 
with functions like pow() and int().
    vector functions
string functions
object functions
array functions
other functions

And a separate section listing them by return type, with links to the 
main documentation.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Sebastian H 
Subject: Re: Is there a "string length" function?
Date: 23 Feb 2003 13:10:01
Message: <3e590e79$1@news.povray.org>
Christopher James Huff wrote:
> In article <3e5601e0@news.povray.org>, Warp <war### [at] tagpovrayorg> 
> wrote:
> 
> 
>>  Functions are categorized based on what they return.
> 
> 
> And I personally have never liked this method.
> 
Now I agree!
Some time ago I was searching for the dot_product(..) syntax
but wasn't able to find it in the "vector functions" category... ;-)

Sebastian H.


Post a reply to this message

From: Will W
Subject: Re: Is there a "string length" function?
Date: 23 Feb 2003 15:50:30
Message: <3e593416@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:3e58e425@news.povray.org...
> Will W <wil### [at] nospamwizzardsnet> wrote:
> > Organizing functions by return type is, for me, an intriguing idea.
>
>   There's a very good reason for this in programming, as I explained
> previously.

Yes, I see that. You are preaching to the choir.

I do not see any compelling reason for changing the way the POV and its
documentation are organized. As I have said elsewhere, I do think a brief
appendix for experienced programmers who are new to POV could be very useful
in cutting down aggravation and stupid sounding questions. But that would be
an added feature, not a change in what has already been done. It would be
something nice to have, but not strictly necessary.


--
Will Woodhull
Thornhenge, SW Oregon, USA
willl.at.thornhenge.net


Post a reply to this message

From: Warp
Subject: Re: Is there a "string length" function?
Date: 23 Feb 2003 18:08:39
Message: <3e595477@news.povray.org>
Christopher James Huff <cja### [at] earthlinknet> wrote:
> other functions

  I'm still not comfortable with that.
  How do you classify a function as "other"? How do I know from a given
function if it's an "other" function?

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Warp
Subject: Re: Is there a "string length" function?
Date: 23 Feb 2003 18:12:30
Message: <3e59555e@news.povray.org>
Christopher James Huff <cja### [at] earthlinknet> wrote:
>>   There are no "object functions" in POV-Ray.

> trace(), min_extent(), max_extent(), inside()...I think that's it.

  Those are vector functions (because they can be used where a vector is
expected). They are not object functions because they can't be used
where an object is expected (there are no such functions in POV-Ray).

  You can call them "functions for getting information about an object",
but don't mix up type terminology with this. That would only cause
confusion.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Christopher James Huff
Subject: Re: Is there a "string length" function?
Date: 23 Feb 2003 18:43:05
Message: <cjameshuff-D944D9.18394423022003@netplex.aussie.org>
In article <3e595477@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   I'm still not comfortable with that.
>   How do you classify a function as "other"? How do I know from a given
> function if it's an "other" function?

If it doesn't fit in with the more specific categories. The "other" 
category would be quite small, and easy to check.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Joseph Zeglinski
Subject: Re: Is there a "string length" function?
Date: 23 Feb 2003 21:24:33
Message: <3e598261@news.povray.org>
"Joseph Zeglinski" <JAZ### [at] rogerscom> wrote in message
news:3e5419b4@news.povray.org...
> Hi,
>     I have a string Value I need to "print". However, in order to scale the
> space for the word to fit on the object, I need to know how many charcaters
> are in the variable. Is there a strlen() function in POVRAY ?
>
> Thanks.
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003
>
>

Gentlemen,
    Pray, thank you one and all ...some 35...so far. It was a simple question,
and wasn't meant to get off topic in some cases, with snide remarks by some.
As I scanned through the barrage of idle conversation, I wasn't sure if I had
inadvertantly logged into Monty Python's flying circus in rehearsal.

    To answer some of your questions about just WHO would be so very lazy
enough to ask such a totally stupid question about a "strlen()) function...I
see why you are dying to learn this answer.

(1) I asked for HELP on the "Newusers" group, because I mistakenly thought it
was meant for newbies on POVRAY, like myself. If that is the case, based on
the replies, I am in the wrong group - is there a "tiny tots for POVRAY"
group?

(2) I was just entering my initial trials with this product, and needed a
quick answer.  But, did I do "any work" to find the answer for myself?

    Well...yes... I downloaded the POVRAY Tutorial (because after a half day's
search on the internet and local bookstores, I couldn't find a POVRAY book,
still in print, even a used one,  to buy. Then I read through all of the
discussions on the POVRAY documentation group, etc. trying to find out if a
book was in the works. Discovered they aren't organized enough to answer at
this time, perhaps ever. Still no strlen() answer... so I looked through the
help file ... without much luck ( I must have missed it, I guess? damned
bi-focals).
    O.K. Needed to get out the heavy artillary - needed to print out (computer
screens are for propeller heads)  the TUTORIAL for POVRAY 3.5 - strange name
for a tombe of 782 pages - needs to be renamed  THE MANUAL or the BIBLE.
Inkjet....forget it. My old Laserjet-2 ... life is too short.
I needed to upgrade my 15 year old, and working great, LJ-2, to something
better.... yes... a Colour HP Laserjet 4600DN ...double sided duplexed colour
printing at an actual 8 seconds a colour page for a mere $4,500 Canadian
pesos.
    Finally, 1 hour 20 minutes, and 782 double sided pages, later I had a
beautiful copy of the colour  POVRAY Tutorial.
    However, as lovely as it is, and as well written as it was, and extremely
well organized, in all of it's Bachus-Naur illustrated explanations, along
with a detailed list of subject matter at the front  - though this entire
section was badly screwed up in PDF - the rest was indeed exquisite.
To my dismay, this turkey ... has no INDEX to scan for a topic quickly. Did
you guys forget something after putting the tombe to bed?
So, I flipped through the pages hunting for anything that talked about
"strings... functions... the meaning of life"  ... (should have read the
responses for that).

    So, after considerable hunting, expenditure of a fair amount of time and
energy, and a premature purchase of a printer for $4,500 ... I was no closer
to the holy grail of a strlen() answer.
Although ...I was beginning to think somebody was stringing me along.

(3) You have been wondering just what kind of a "dolt" ... you were being kind
... would dare ask such a stupid and simplistic answer from such an esteemed
and areodite group of newbies(?), who would be so patient with a newcomer with
his first post to the website, expecting someone equally new, to answer
quickly, patiently, and simply - from what he had himself learned in his early
days as a newbie.

The ANSWER....
    Well, I started out in "Machine Language Programming" (that's OP-CODES
entered using mechanical toggle switches, on a front panel with neon bulbs -
later advanced to typing them into a Selectric typewriter console on the old
IBM-1620 console - loved that machine, wish I had one today. That was using
binary one's and zero's, for most who are too young to know about such things,
back in the early 60's (... that's in the 1900's), and soon graduated to using
an ASSEMBLER. Finally, worked my way up through Fortran, Snowball, and several
others I don't recall, upto "The Great C+".

    So to your question "How does he know about something called strlen()"
enough to spell it correctly in a question  - ... I tripped over it while
reading my C-Manual.

Oh yes - is he an artiste? No, just a profesional engineer, with years of
dabbling in computer graphics as an interest. I would never have tried POVRAY
if I didn't find a sudden need to use it with EagleCAD 3D circuit board
eye-candy creations. Then, like most, got addicted... but I'm working on that
problem.

(4) Finally ... no one actually took the effort to simply copy the strlen()
syntax statement into a reply.
And I thought everybody was so expert in such a simple task.

    I really enjoyed the serious sessions of navel gazing ...or is it navel
grazing...that this question provoked. It might end up improving the
documentation ... perhaps by adding something like an INDEX section? Reading
the replies, I certainly learned a lot about the intricacies of language
structure, and how poorly the documentation in POVRAY is considered, by some.

    Then again... maybe I should have hunted for THE MANUAL instead of the
TUTORIAL at the POVRAY website. Or perhaps, have downloaded the POVRAY source
code, and skimmed through it - surely would have found a strlen() something.
My mistake, I just took the "obviously" easy way out.

I now have my answer ... but did anybody spot the answer to my question in all
of the 35 or so replies thus far?


...This has been niether a rant nor a flame...
but perhaps a tale told by a Dolt
full of sound and fury...
signifying nothing...

Cheers,
the DOLT !



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.456 / Virus Database: 256 - Release Date: 18/02/2003


Post a reply to this message

From: Christopher James Huff
Subject: Re: Is there a "string length" function?
Date: 23 Feb 2003 22:31:07
Message: <cjameshuff-612825.22273723022003@netplex.aussie.org>
In article <3e598261@news.povray.org>,
 "Joseph Zeglinski" <JAZ### [at] rogerscom> wrote:

> (1) I asked for HELP on the "Newusers" group, because I mistakenly thought it
> was meant for newbies on POVRAY, like myself. If that is the case, based on
> the replies, I am in the wrong group - is there a "tiny tots for POVRAY"
> group?

It's just generally assumed that the manual is the first place people 
will look. That's why it exists, and is included with every distribution 
of POV-Ray.


>     Well...yes... I downloaded the POVRAY Tutorial (because after a half day's
> search on the internet and local bookstores, I couldn't find a POVRAY book,
> still in print, even a used one,  to buy. Then I read through all of the
> discussions on the POVRAY documentation group, etc. trying to find out if a
> book was in the works. Discovered they aren't organized enough to answer at
> this time, perhaps ever. Still no strlen() answer... so I looked through the
> help file ... without much luck ( I must have missed it, I guess? damned
> bi-focals).

I don't know what you downloaded. The manual is not separately available 
in an easily downloadable form, and there is no document called anything 
like "The POV-Ray Tutorial".
As for books...there are none that deal with a recent version of 
POV-Ray, and they would be unlikely to cover the strlen() function 
anyway...it's already documented in the manual.


>     O.K. Needed to get out the heavy artillary - needed to print out (computer
> screens are for propeller heads)  the TUTORIAL for POVRAY 3.5 - strange name
> for a tombe of 782 pages - needs to be renamed  THE MANUAL or the BIBLE.
> Inkjet....forget it. My old Laserjet-2 ... life is too short.

If you are talking about the document that came with POV-Ray, that *is* 
the manual, it just contains 2 tutorials. And it would be easier to 
search the electronic version than hunt through a hard copy.
Printing the manual takes a lot of paper, ink, and time, you miss out on 
any corrections, plus you would need to re-print it for POV updates. I 
initially printed large chunks of the manual twice, found I never used 
the hard copies, and gave up on it.


> To my dismay, this turkey ... has no INDEX to scan for a topic quickly. Did
> you guys forget something after putting the tombe to bed?

It's designed as an electronic document. Page numbers are pretty 
useless, it uses hyperlinks.


> (4) Finally ... no one actually took the effort to simply copy the strlen()
> syntax statement into a reply.
> And I thought everybody was so expert in such a simple task.

Well, you pretty much used it in your original message. strlen(STRING)


>     I really enjoyed the serious sessions of navel gazing ...or is it navel
> grazing...that this question provoked. It might end up improving the
> documentation ... perhaps by adding something like an INDEX section? Reading
> the replies, I certainly learned a lot about the intricacies of language
> structure, and how poorly the documentation in POVRAY is considered, by some.

An index of the type you are looking for wouldn't really be very useful. 
The manual *does* have an index (surprisingly enough, with the title of 
"Index"), but it does not use page numbers, it uses section numbers and 
hyperlinks, as is appropriate for a document intended to be read 
electronically.


>     Then again... maybe I should have hunted for THE MANUAL instead of the
> TUTORIAL at the POVRAY website. Or perhaps, have downloaded the POVRAY source
> code, and skimmed through it - surely would have found a strlen() something.
> My mistake, I just took the "obviously" easy way out.

I don't know where you got "THE TUTORIAL". There is no tutorial document 
remotely like what you describe, so you must be speaking of some version 
of the manual, and probably an old version because the new one isn't 
downloadable separately. Finding the current manual is quite easy: go to 
povray.org, click Documentation, or just find it in your POV-Ray 
installation.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Christopher James Huff
Subject: Re: Is there a "string length" function?
Date: 23 Feb 2003 22:54:41
Message: <cjameshuff-B38C1C.22511223022003@netplex.aussie.org>
In article <3e59555e@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   You can call them "functions for getting information about an object",
> but don't mix up type terminology with this. That would only cause
> confusion.

I'm not using type terminology. I'm categorizing them by use. When I 
look for documentation on a function, I look for it by use, not by 
return type. I don't care what I'm going to use the return for, I care 
what I'm going to use the function with.
IMO, return type is a terrible way to organize things, with very limited 
use.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 6 Messages >>>

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