POV-Ray : Newsgroups : povray.advanced-users : how to read long strings (looking for method and bug report) Server Time
27 Nov 2024 02:27:39 EST (-0500)
  how to read long strings (looking for method and bug report) (Message 1 to 8 of 8)  
From: Wlodzimierz ABX Skiba
Subject: how to read long strings (looking for method and bug report)
Date: 21 Feb 2001 21:19:19
Message: <3a947727@news.povray.org>
I had idea - building own interface to read lots of parameters to scenes from
external file with simple syntax
the easiest way should be prepare special patch but I wanted write parser as
macro and try parsing of parsing :-)
I imagined that first char of my definition file could be " and last one too -
this means that this definition file would be one long string
I thought that such construction should do what I want :

#macro parse_model(file_name)
  #local Input=#include file_name
  // parsing stuff
#end
parse_model("input.txt")

but for my input file fastly I recived message : String too long

than I found such information in help : <<String literals begin with a double
quote mark '"' which is followed by up to 256 printable ASCII characters and are
terminated by another double quote mark.>>
hmm, I can't but ... perhaps with #read ?
I looked in manual something about max length of string variables (not string
literals) - and I didn't found anything - than I checked this script :

#declare A=" "
#declare A=concat(A,A) // 2
#declare A=concat(A,A) // 4
#declare A=concat(A,A) // 8
#declare A=concat(A,A) // 16
#declare A=concat(A,A) // 32
#declare A=concat(A,A) // 64
#declare A=concat(A,A) // 128
#declare A=concat(A,A) // 256
#declare A=concat(A,A) // 512
#declare A=concat(A,A) // 1024

it was parsed and run fine
than I changed my parsing macro to this:

#macro parse_model(file_name)
  #local Input=""
  #fopen InputFile file_name read
  #read (InputFile,Input)
  #fclose InputFile
  // parsing stuff
#end
parse_model("input.txt")

but again I achived message : String too long

than I again typed test but this time with showing result at end

#declare A=" "
#declare A=concat(A,A) // 2
...
#declare A=concat(A,A) // 1024
#warning concat(A,";\n")

and this caused the most strange thing
povray exited
no, not crashed, just disapeared from tasks and from screen
it wasn't even normal exit becouse after next start he forgot names of opened
files
I've tested this with MegaPOV 0.7 and with good _old_ POV-Ray 3.1g on Windows NT
4
and both exited

two things:
1. can anybody confirm this bug ?
2. can anybody propose another simple method for build reading from external
text file with specified structure ?

thanks for long reading

ABX


Post a reply to this message

From: Warp
Subject: Re: how to read long strings (looking for method and bug report)
Date: 22 Feb 2001 05:28:00
Message: <3a94e9b0@news.povray.org>
In povray.general Wlodzimierz ABX Skiba <abx### [at] abxartpl> wrote:
: 1. can anybody confirm this bug ?

  Could you post a short code that causes the bug so that we could just
test it right away? It would be the easiest way.

  The behaviour you are describing sounds like a memory leak or similar
(povray writes to unallocated memory).

: 2. can anybody propose another simple method for build reading from external
: text file with specified structure ?

  Like for example the PCM file format?

-- 
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

From: Thorsten Froehlich
Subject: Re: how to read long strings (looking for method and bug report)
Date: 22 Feb 2001 19:20:52
Message: <3a95ace4$1@news.povray.org>
In article <3a94e9b0@news.povray.org> , Warp <war### [at] tagpovrayorg>  
wrote:

>   Could you post a short code that causes the bug so that we could just
> test it right away? It would be the easiest way.
>
>   The behaviour you are describing sounds like a memory leak or similar
> (povray writes to unallocated memory).

The bug is part of "String literals can only be 125 characters long" in
povray.bugreports posted Thu, 3 Jun 1999 01:56:56 +0200, Message-ID:
<3755c4f2.0@news.povray.org> .   The bug is fixed in POV-Ray 3.5 (not
release yet).


    Thorsten


____________________________________________________
Thorsten Froehlich
e-mail: mac### [at] povrayorg

I am a member of the POV-Ray Team.
Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Wlodzimierz ABX Skiba
Subject: Re: how to read long strings (looking for method and bug report)
Date: 23 Feb 2001 04:36:23
Message: <3a962f17@news.povray.org>
Warp wrote in message <3a94e9b0@news.povray.org>...
> In povray.general Wlodzimierz ABX Skiba <abx### [at] abxartpl> wrote:
> : 1. can anybody confirm this bug ?
>
> Could you post a short code that causes the bug so that we could just
> test it right away? It would be the easiest way.

but ... it is sended in my post :-)

#declare A=" "
#declare A=concat(A,A) // 2
#declare A=concat(A,A) // 4
#declare A=concat(A,A) // 8
#declare A=concat(A,A) // 16
#declare A=concat(A,A) // 32
#declare A=concat(A,A) // 64
#declare A=concat(A,A) // 128
#declare A=concat(A,A) // 256
#declare A=concat(A,A) // 512
#declare A=concat(A,A) // 1024
#warning concat(A,";\n")

> : 2. can anybody propose another simple method for build reading from external
> : text file with specified structure ?
>
> Like for example the PCM file format?


thanks for advice

ABX


Post a reply to this message

From: Wlodzimierz ABX Skiba
Subject: Re: how to read long strings (looking for method and bug report)
Date: 23 Feb 2001 04:39:09
Message: <3a962fbd@news.povray.org>
Thorsten Froehlich wrote in message <3a95ace4$1@news.povray.org>...
> The bug is part of "String literals can only be 125 characters long" in
> povray.bugreports posted Thu, 3 Jun 1999 01:56:56 +0200, Message-ID:
> <3755c4f2.0@news.povray.org> .   The bug is fixed in POV-Ray 3.5 (not
> release yet).


it is fixed but for what ?
to be 255 characters long or to be unlimited ?
I hope it's not discussion about 3.5 :-)

ABX


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: how to read long strings (looking for method and bug report)
Date: 23 Feb 2001 10:03:55
Message: <3a967bdb$1@news.povray.org>
In article <3a962fbd@news.povray.org> , "Wlodzimierz ABX Skiba" 
<abx### [at] abxartpl> wrote:

> unlimited


      Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Wlodzimierz ABX Skiba
Subject: Re: how to read long strings (looking for method and bug report)
Date: 26 Feb 2001 04:35:38
Message: <3a9a236a@news.povray.org>
Thorsten Froehlich wrote in message <3a967bdb$1@news.povray.org>...
> > unlimited
> Thorsten


thanks to unlimited Thorsten :-)

ABX


Post a reply to this message

From: Wlodzimierz ABX Skiba
Subject: Re: how to read long strings (looking for method and bug report)
Date: 26 Feb 2001 04:47:48
Message: <3a9a2644@news.povray.org>
Thorsten Froehlich wrote in message <3a967bdb$1@news.povray.org>...
> > unlimited
> Thorsten


thanks to unlimited Thorsten :-)

ABX


Post a reply to this message

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