POV-Ray : Newsgroups : povray.general : Has string handling been changed or improved? Server Time
30 Jul 2024 02:20:30 EDT (-0400)
  Has string handling been changed or improved? (Message 11 to 19 of 19)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Edouard
Subject: Re: Has string handling been changed or improved?
Date: 10 May 2010 21:35:00
Message: <web.4be8b3426ddd2def516917dd0@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote:

> Some recent code posted by Edouard (his "DF3 Proximity Testbed")--meant for use
> with one of the 3.7 betas, I *think*--makes use of this kind of construct, which
> apparently does work now. (I'm just guessing; I only attempted to run part of
> his code in 3.6.1, which produced the same error. Silly to do, I know; but I
> like to experiment!)
>
> So a question, just out of curiosity: *Has* string handling been improved since
> 3.6.1, to successfully process this kind of thing? I haven't yet been able to
> find any info about it, when doing a search of the newsgroups.

I did the same thing! I wrote that code on 3.7 and then ran it on 3.6 and was
all "why doesn't that work"?

As other people have pointed out, the change is noted on the beta page. I find
it quite a useful addition.

The proximity creation code will only work on 3.7 (for DF3 writing, mesh
inside() testing, etc), but you should, in theory, be able to read the prox and
DF3 files on 3.6 (I haven't actually tested it though).

Cheers,
Edouard.


Post a reply to this message

From: Warp
Subject: Re: Has string handling been changed or improved?
Date: 11 May 2010 07:40:16
Message: <4be94220@news.povray.org>
Alain <aze### [at] qwertyorg> wrote:
> It does a loop and test each characters in turn. The first pair of 
> missmatching will trigger the condition. A successfull test for equality 
> is the longest, or if only the last character is different, as you had 
> to compare every characters.

  More briefly: The comparison operators are simply a shortcut to calling
the strcmp() function of the SDL syntax.

-- 
                                                          - Warp


Post a reply to this message

From: Kenneth
Subject: Re: Has string handling been changed or improved?
Date: 11 May 2010 08:40:00
Message: <web.4be94fb56ddd2defae92d9930@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:

>   More briefly: The comparison operators are simply a shortcut to calling
> the strcmp() function of the SDL syntax.
>

Aha!  The 'key' to this mystery at last.  Thanks, Warp (and to Alain and Jim
Holsenbach as well.)

In light of this info, methinks that the wiki needs a bit of fleshing out, to
more fully describe the process. Warp's post could be included verbatim, for
example. (*Although*, even the strcmp() function's explanation is rather arcane
to me... "ASCII collating sequence..." ?? Egads.) It presupposes some info that
non-programmers may have trouble grasping. (Or else *I'm* the 'odd man out'
here, which is certainly possible.)

As it is, the wiki info about the new string operators leaves me with the
feeling that I'm having to grasp at straws to understand it; perhaps others
might feel the same way. Kind of like this situation: "It's generally known that
Einstein's gravity equations describe these details quite clearly, so there's no
need to discuss them here."

;-P

Ken


Post a reply to this message

From: Jim Holsenback
Subject: Re: Has string handling been changed or improved?
Date: 11 May 2010 08:51:20
Message: <4be952c8$1@news.povray.org>
On 05/11/2010 09:38 AM, Kenneth wrote:
> As it is, the wiki info about the new string operators leaves me with the
> feeling that I'm having to grasp at straws to understand it; perhaps others
> might feel the same way. Kind of like this situation: "It's generally known that
> Einstein's gravity equations describe these details quite clearly, so there's no
> need to discuss them here."

I guess the only fault I can find with what's there is my choice of
example strings ... instead of the testing/testing123 example perhaps
something like abc < abd might be a little clearer :-)

Jim


Post a reply to this message

From: Kenneth
Subject: Re: Has string handling been changed or improved?
Date: 11 May 2010 09:05:01
Message: <web.4be955406ddd2defae92d9930@news.povray.org>
Jim Holsenback <jho### [at] povrayorg> wrote:

> I guess the only fault I can find with what's there is my choice of
> example strings ... instead of the testing/testing123 example perhaps
> something like abc < abd might be a little clearer :-)
>


Yes yes, I think that would help. Good idea. (In my attempt to grasp what was
going on, I didn't know *how* to give a better example, or if it even needed
one.)

Ken


Post a reply to this message

From: Jim Holsenback
Subject: Re: Has string handling been changed or improved?
Date: 11 May 2010 09:11:26
Message: <4be9577e@news.povray.org>
On 05/11/2010 10:01 AM, Kenneth wrote:
> Yes yes, I think that would help. Good idea. (In my attempt to grasp what was
> going on, I didn't know *how* to give a better example, or if it even needed
> one.)

howz zat?
http://wiki.povray.org/content/Documentation:Reference_Section_2.3#String_Relational_Operators

Jim


Post a reply to this message

From: Warp
Subject: Re: Has string handling been changed or improved?
Date: 11 May 2010 09:19:18
Message: <4be95956@news.povray.org>
Jim Holsenback <jho### [at] povrayorg> wrote:
> On 05/11/2010 10:01 AM, Kenneth wrote:
> > Yes yes, I think that would help. Good idea. (In my attempt to grasp what was
> > going on, I didn't know *how* to give a better example, or if it even needed
> > one.)

> howz zat?
>
http://wiki.povray.org/content/Documentation:Reference_Section_2.3#String_Relational_Operators

  I think that it should mention that the comparison operators are completely
equivalent to calling strcmp(). Maybe give an example like:

    string1 = string2

is completely equivalent to:

    strcmp(string1, string2) = 0

-- 
                                                          - Warp


Post a reply to this message

From: Kenneth
Subject: Re: Has string handling been changed or improved?
Date: 11 May 2010 09:20:00
Message: <web.4be958ac6ddd2defae92d9930@news.povray.org>
"Edouard" <pov### [at] edouardinfo> wrote:
> "Kenneth" <kdw### [at] earthlinknet> wrote:

> > Some recent code posted by Edouard (his "DF3 Proximity Testbed")--meant for
> > use with one of the 3.7 betas, I *think*--makes use of this kind of
> > construct, which apparently does work now. (I'm just guessing; I only
> > attempted to run part of his code in 3.6.1, which produced the same error.

> I did the same thing! I wrote that code on 3.7 and then ran it on 3.6 and was
> all "why doesn't that work"?
>
> The proximity creation code will only work on 3.7 (for DF3 writing, mesh
> inside() testing, etc), but you should, in theory, be able to read the prox and
> DF3 files on 3.6 (I haven't actually tested it though).

Thanks; I assumed that was the case. As is my usual wacky way of experimenting,
I just commented-out your #version 3.7 directive, and proceeded blindly! ;-)

Ken


Post a reply to this message

From: Kenneth
Subject: Re: Has string handling been changed or improved?
Date: 11 May 2010 09:35:00
Message: <web.4be95c816ddd2defae92d9930@news.povray.org>
Jim Holsenback <jho### [at] povrayorg> wrote:
> On 05/11/2010 10:01 AM, Kenneth wrote:
> > Yes yes, I think that would help. Good idea. (In my attempt to grasp what was
> > going on, I didn't know *how* to give a better example, or if it even needed
> > one.)
>
> howz zat?
>
http://wiki.povray.org/content/Documentation:Reference_Section_2.3#String_Relational_Operators
>

Oops! Guilty as charged. :-[


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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