POV-Ray : Newsgroups : povray.object-collection : I think I'm having trouble with underscores. Server Time
28 Mar 2024 12:22:42 EDT (-0400)
  I think I'm having trouble with underscores. (Message 1 to 8 of 8)  
From: Charles C
Subject: I think I'm having trouble with underscores.
Date: 14 Oct 2007 16:40:00
Message: <web.47127df451c300c9c667cf480@news.povray.org>
Hi,
The other day I tried to upload a file to the collection "scale_convert.inc"
containing a macro named "Scale_Convert()".  I did not use a prefix, so that
meant that, if I understand things correctly, the file name before the "."
and the contribution-name needed to match.  That's where there was a snag.
It looks like an "_" is not considered a valid character in the
contribution-name field.  So to get around this, I renamed my contribution
"scale-convert" and the file-name likewise.

I also got some kind of an sql error message, apparently/possibly related to
where I used quotation marks in my description.  I'm not sure.  I have the
exact error message copied down at home, but right now I am not at home.*
If it would be useful I can try to email it to myself and get it posted
here in the next day or so.

I wasn't sure that the system took the submission, so I tried again, still
with the "-" instead of an "_" but I got an error that the entry name has
already been taken.  Any help sorting this out would be appreciated.

Charles

PS:
*From home I have trouble logging onto news.povray.org, probably due to my
high latency connection.  Every log-in attempt produces another log-in
page.  That issue mostly went away for quite a long time but has come back
recently.  Does anybody know if there's a latency-tolerance setting
somewhere? If there is, it'd sure make things easier for me and my sub-par
home connection. :-)


Post a reply to this message

From: Chris B
Subject: Re: I think I'm having trouble with underscores.
Date: 14 Oct 2007 20:00:12
Message: <4712ad8c$1@news.povray.org>
Hi Charles,

"Charles C" <nomail@nomail> wrote in message 
news:web.47127df451c300c9c667cf480@news.povray.org...
> Hi,
> The other day I tried to upload a file to the collection 
> "scale_convert.inc"
> containing a macro named "Scale_Convert()".  I did not use a prefix, so 
> that
> meant that, if I understand things correctly, the file name before the "."
> and the contribution-name needed to match.  That's where there was a snag.
> It looks like an "_" is not considered a valid character in the
> contribution-name field.  So to get around this, I renamed my contribution
> "scale-convert" and the file-name likewise.
>

Yes. If you choose not to use a prefix, then the file names, macro names and 
anything else exposed to the scene file using the include file needs to 
start with the contribution name. If there's anything more to the name you 
can use an underscore character to separate the contribution name and the 
rest of the name. Because the underscore is used to separate the 
contribution name from the rest of the name you mustn't use underscores in 
the contribution name itself. I've actually removed the '-' from the 
permitted characters too, as this can't be used in macro names, variable 
names etc. The permitted characters for the different fields are listed in 
the users guide at 
http://lib-devel.povray.org/usersguide/04contributing.html#submission.

I've zipped up a copy of the files you submitted having renamed the files, 
macros and exposed variables based on a contribution name of 'ScaleConvert'. 
I've added a scene file that illustrates the macro and a thumbnail that you 
may consider suitable for display on the search results (or you may be able 
to come up with something more imaginative). I'll email a copy to the 
address you gave during registration. If you'd like to check that you're 
happy with the files then resubmit them using a contribution name of 
'ScaleConvert', it should work now. I've included the description and 
keywords that you entered within text files in the zip file. You can pull 
those texts into the submission form using the Browse buttons (I've made a 
few typographical changes to the description).

> I also got some kind of an sql error message, apparently/possibly related 
> to
> where I used quotation marks in my description.  I'm not sure.  I have the
> exact error message copied down at home, but right now I am not at home.*
> If it would be useful I can try to email it to myself and get it posted
> here in the next day or so.
>

I was able to replicate this error and it was indeed to do with the quotes. 
I've fixed the problem on the server and removed the bits that were saved on 
the first attempt, which resulted in the error you got when you tried to 
resubmit. You should be able to resubmit now without such errors.

> I wasn't sure that the system took the submission, so I tried again, still
> with the "-" instead of an "_" but I got an error that the entry name has
> already been taken.  Any help sorting this out would be appreciated.
>
> Charles
>

Regards,
Chris B.


Post a reply to this message

From: Charles C
Subject: Re: I think I'm having trouble with underscores.
Date: 15 Oct 2007 00:55:00
Message: <web.4712f18227705f80b87ba68c0@news.povray.org>
"Chris B" <c_b### [at] btconnectcomnospam> wrote:
> Hi Charles,
>
> "Charles C" <nomail@nomail> wrote in message
> news:web.47127df451c300c9c667cf480@news.povray.org...
> > Hi,
> > The other day I tried to upload a file to the collection
> > "scale_convert.inc"
> > containing a macro named "Scale_Convert()".  I did not use a prefix, so
> > that
> > meant that, if I understand things correctly, the file name before the "."
> > and the contribution-name needed to match.  That's where there was a snag.
> > It looks like an "_" is not considered a valid character in the
> > contribution-name field.  So to get around this, I renamed my contribution
> > "scale-convert" and the file-name likewise.
> >
>
> Yes. If you choose not to use a prefix, then the file names, macro names and
> anything else exposed to the scene file using the include file needs to
> start with the contribution name. If there's anything more to the name you
> can use an underscore character to separate the contribution name and the
> rest of the name. Because the underscore is used to separate the
> contribution name from the rest of the name you mustn't use underscores in
> the contribution name itself. I've actually removed the '-' from the
> permitted characters too, as this can't be used in macro names, variable
> names etc. The permitted characters for the different fields are listed in
> the users guide at
> http://lib-devel.povray.org/usersguide/04contributing.html#submission.
>
> I've zipped up a copy of the files you submitted having renamed the files,
> macros and exposed variables based on a contribution name of 'ScaleConvert'.
> I've added a scene file that illustrates the macro and a thumbnail that you
> may consider suitable for display on the search results (or you may be able
> to come up with something more imaginative). I'll email a copy to the
> address you gave during registration. If you'd like to check that you're
> happy with the files then resubmit them using a contribution name of
> 'ScaleConvert', it should work now. I've included the description and
> keywords that you entered within text files in the zip file. You can pull
> those texts into the submission form using the Browse buttons (I've made a
> few typographical changes to the description).
>
> > I also got some kind of an sql error message, apparently/possibly related
> > to
> > where I used quotation marks in my description.  I'm not sure.  I have the
> > exact error message copied down at home, but right now I am not at home.*
> > If it would be useful I can try to email it to myself and get it posted
> > here in the next day or so.
> >
>
> I was able to replicate this error and it was indeed to do with the quotes.
> I've fixed the problem on the server and removed the bits that were saved on
> the first attempt, which resulted in the error you got when you tried to
> resubmit. You should be able to resubmit now without such errors.
>
> > I wasn't sure that the system took the submission, so I tried again, still
> > with the "-" instead of an "_" but I got an error that the entry name has
> > already been taken.  Any help sorting this out would be appreciated.
> >
> > Charles
> >
>
> Regards,
> Chris B.


(First, Woohoo! I'm logged on from home!)

Thanks Chris!   Making a demo scene and everything, all I can say is THANKS.
:-)

I have a couple of questions which I'll try to find answers to.  Here
though, I'll try to be brief before my session times out and I can't get
logged on again.

One question is, what to do about something like this?  I copied the
View_POV_Include_Stack line from what's in a lot of the POV-Ray distro
#includes.  If fully compliant, the variable needs ScaleConvert_ at the
beginning but to be meaninful it needs to match what's in other #includes:

#ifdef(ScaleConvert_View_POV_Include_Stack)  #debug "including
scaleconvert.incn" #end

versus:

#ifdef(View_POV_Include_Stack)  #debug "including scaleconvert.incn" #end


Thanks again,
Charles


Post a reply to this message

From: Charles C
Subject: Re: I think I'm having trouble with underscores.
Date: 15 Oct 2007 01:00:00
Message: <web.4712f2d227705f80b87ba68c0@news.povray.org>
"Chris B" <c_b### [at] btconnectcomnospam> wrote:

> The permitted characters for the different fields are listed in
> the users guide at
> http://lib-devel.povray.org/usersguide/04contributing.html#submission.

BTW I don't have access to that.
Charles


Post a reply to this message

From: Charles C
Subject: Re: I think I'm having trouble with underscores.
Date: 15 Oct 2007 03:00:01
Message: <web.47130ef527705f80b87ba68c0@news.povray.org>
Before I go to bed, I just want to say, nevermind my last two hasty
questions/comment in this thread... Normally I like to look for answers
before I ask, but didn't this time for reasons explained above.

Anyway it looks like somebody's noticed my post-script.  Thanks  :-)

Charles


Post a reply to this message

From: Chris B
Subject: Re: I think I'm having trouble with underscores.
Date: 15 Oct 2007 03:55:26
Message: <47131cee$1@news.povray.org>
"Charles C" <nomail@nomail> wrote in message 
news:web.4712f2d227705f80b87ba68c0@news.povray.org...
> "Chris B" <c_b### [at] btconnectcomnospam> wrote:
>
>> The permitted characters for the different fields are listed in
>> the users guide at
>> http://lib-devel.povray.org/usersguide/04contributing.html#submission.
>
> BTW I don't have access to that.
> Charles
>

Woops, that should have been 
http://lib.povray.org/usersguide/04contributing.html#submission.


Post a reply to this message

From: Chris B
Subject: Re: I think I'm having trouble with underscores.
Date: 15 Oct 2007 04:06:17
Message: <47131f79@news.povray.org>
"Charles C" <nomail@nomail> wrote in message 
news:web.4712f18227705f80b87ba68c0@news.povray.org...
> "Chris B" <c_b### [at] btconnectcomnospam> wrote:

> One question is, what to do about something like this?  I copied the
> View_POV_Include_Stack line from what's in a lot of the POV-Ray distro
> #includes.  If fully compliant, the variable needs ScaleConvert_ at the
> beginning but to be meaninful it needs to match what's in other #includes:
>
> #ifdef(ScaleConvert_View_POV_Include_Stack)  #debug "including
> scaleconvert.incn" #end
>
> versus:
>
> #ifdef(View_POV_Include_Stack)  #debug "including scaleconvert.incn" #end
>
>
> Thanks again,
> Charles
>

I was probably a little over zealous there in my edits. I 'm sure we will 
need to document a couple of 'exceptions', such as this one, where variables 
do need a cross-file context. The server doesn't check variable names etc. 
within the file which is why it relies upon the contributor making an 
assessment about the level of compliance of their contribution.

Regards,
Chris B.


Post a reply to this message

From: Charles C
Subject: Re: I think I'm having trouble with underscores.
Date: 15 Oct 2007 12:50:01
Message: <web.47139a1b27705f80c667cf480@news.povray.org>
"Chris B" <c_b### [at] btconnectcomnospam> wrote:
> "Charles C" <nomail@nomail> wrote in message
> news:web.4712f18227705f80b87ba68c0@news.povray.org...
> > "Chris B" <c_b### [at] btconnectcomnospam> wrote:
>
> > One question is, what to do about something like this?  I copied the
> > View_POV_Include_Stack line from what's in a lot of the POV-Ray distro
> > #includes.  If fully compliant, the variable needs ScaleConvert_ at the
> > beginning but to be meaninful it needs to match what's in other #includes:
> >
> > #ifdef(ScaleConvert_View_POV_Include_Stack)  #debug "including
> > scaleconvert.incn" #end
> >
> > versus:
> >
> > #ifdef(View_POV_Include_Stack)  #debug "including scaleconvert.incn" #end
> >
> >
> > Thanks again,
> > Charles
> >
>
> I was probably a little over zealous there in my edits. I 'm sure we will
> need to document a couple of 'exceptions', such as this one, where variables
> do need a cross-file context. The server doesn't check variable names etc.
> within the file which is why it relies upon the contributor making an
> assessment about the level of compliance of their contribution.
>
> Regards,
> Chris B.


Sounds good.  What I ended up doing was putting in both lines with the
non-prefixed version commented out.

Here's another possible one, but I'll understand if people don't go for it.
Actually I'd be more surprised if people do:   I'd like to propose an
exception for something like Main_POV_File or Main_Scene_File as a
globally-ok string variable.   (A few months ago I proposed a POV-Ray
keyword main_pov_file or main_scene_file or similar with a similar
purpose.)  The purpose of the variable-version of this would be to make it
easier to create self-demonstrating or renderable #includes using a system
which can easily be disabled by default. (..by including the line:
#declare Main_Scene_File = "I don't use this system." which must be
commented out before it will trigger the include file to create an instance
of the object, camera, lightsource etc.)  If using this system, no edits of
#if(1) #end toggles are necessary, and you can easily go back and forth
between using the include file as an include file, or using it as a
self-rendering file.

Charles


Post a reply to this message

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