1. a different parse question

can someone suggest the easiest way of stripping {48} to 48. i am
getting a type check failure using value(). i suspect it is due to the
brackets.


type_check failure, ch is {48}

:(

new topic     » topic index » view message » categorize

2. Re: a different parse question

spent memory wrote:
> 
> can someone suggest the easiest way of stripping {48} to 48. i am
> getting a type check failure using value(). i suspect it is due to the
> brackets.
> 
> 
> type_check failure, ch is {48}
> 

Let's see your exact code.  We can probably clear up several things at once for
you...

new topic     » goto parent     » topic index » view message » categorize

3. Re: a different parse question

for i = 1 to length(Trianglearray) do

              for j = 1 to length(Trianglearray[i]) do

      >>>>    Trianglearray[i][j] = value(Trianglearray[i][j])   
<<<<<   bad line
                  Trianglearray[i][j] = Trianglearray[i][j][2] 
              
              end for

end for

--This is the error below

D:\EUPHORIA\include\get.e:46 in procedure get_ch() 
type_check failure, ch is {48'0'} 

... called from D:\EUPHORIA\include\get.e:306 in function value()  
    string = {
               {48'0'},
               {49'1'},
               {50'2'},
               {48'0'},
               {48'0'},
               {48'0'}
             }

im pretty sure all i need to do is strip this code down to {48,49,50,48,48,48}

what is the easiest way of doing that ??

new topic     » goto parent     » topic index » view message » categorize

4. Re: a different parse question

spent memory wrote:
> 
> for i = 1 to length(Trianglearray) do
> 
>               for j = 1 to length(Trianglearray[i]) do
> 
>       >>>>    Trianglearray[i][j] = value(Trianglearray[i][j])   
> <<<<<   bad line
>                   Trianglearray[i][j] = Trianglearray[i][j][2] 
>               
>               end for
> 
> end for
> 
> --This is the error below
> 
> D:\EUPHORIA\include\get.e:46 in procedure get_ch() 
> type_check failure, ch is {48'0'} 
> 
> ... called from D:\EUPHORIA\include\get.e:306 in function value()  
>     string = {
>                {48'0'},
>                {49'1'},
>                {50'2'},
>                {48'0'},
>                {48'0'},
>                {48'0'}
>              }
> 
> im pretty sure all i need to do is strip this code down to {48,49,50,48,48,48}
> 
Yes, that's true, but rather than strip it down at this point, you need to fix
whatever is causing all the characters to individual sequences in the first
place.  So let's see the section of code where it reads in the array from the
file (I assume it is a file)...

new topic     » goto parent     » topic index » view message » categorize

5. Re: a different parse question

bah im an idiot i just needed another for statement, must be tired :|


On Fri, 26 Nov 2004 02:43:33 +1000, spent memory <spent.memory at gmail.com>
wrote:
> 
> 
> for i = 1 to length(Trianglearray) do
> 
>              for j = 1 to length(Trianglearray[i]) do
> 
>      >>>>    Trianglearray[i][j] = value(Trianglearray[i][j])
> <<<<<   bad line
>                  Trianglearray[i][j] = Trianglearray[i][j][2]
> 
>              end for
> 
> end for
> 
> --This is the error below
> 
> D:\EUPHORIA\include\get.e:46 in procedure get_ch()
> type_check failure, ch is {48'0'}
> 
> ... called from D:\EUPHORIA\include\get.e:306 in function value()
>    string = {
>               {48'0'},
>               {49'1'},
>               {50'2'},
>               {48'0'},
>               {48'0'},
>               {48'0'}
>             }
> 
> im pretty sure all i need to do is strip this code down to {48,49,50,48,48,48}
> 
> what is the easiest way of doing that ??
> 
>

new topic     » goto parent     » topic index » view message » categorize

6. Re: a different parse question

my program is 11k at this point it is an include file (.e) that
supplies routines for the main module of the program. there are 3
other routines that work fine using the exact same read and strip and
value method i use. if i change the way it is read in no doubt it will
change these 3 other routines. i don't want that. at this point i see
no problem with just stripping them down.thanks anyway




 


On Thu, 25 Nov 2004 08:58:50 -0800, Andy Serpa <guest at rapideuphoria.com>
wrote:
> 
> 
> 
> posted by: Andy Serpa <ac at onehorseshy.com>
> 
> spent memory wrote:
> >
> > for i = 1 to length(Trianglearray) do
> >
> >               for j = 1 to length(Trianglearray[i]) do
> >
> >       >>>>    Trianglearray[i][j] = value(Trianglearray[i][j])
> > <<<<<   bad line
> >                   Trianglearray[i][j] = Trianglearray[i][j][2]
> >
> >               end for
> >
> > end for
> >
> > --This is the error below
> >
> > D:\EUPHORIA\include\get.e:46 in procedure get_ch()
> > type_check failure, ch is {48'0'}
> >
> > ... called from D:\EUPHORIA\include\get.e:306 in function value()
> >     string = {
> >                {48'0'},
> >                {49'1'},
> >                {50'2'},
> >                {48'0'},
> >                {48'0'},
> >                {48'0'}
> >              }
> >
> > im pretty sure all i need to do is strip this code down to
> > {48,49,50,48,48,48}
> > 
> Yes, that's true, but rather than strip it down at this point, you need to fix
> whatever is causing all the characters to individual sequences in the first
> place.  So let's see the section of code where it reads in the array from the
> file (I assume it is a file)...
> 
> 
> 
> 
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu