Re: typecasts again

new topic     » goto parent     » topic index » view thread      » older message » newer message

On 11 Jan 2003, at 8:13, Derek Parnell wrote:

> 
> > > Kat wrote:
> > > > This line:
> > > >
> > > > while sequence(TheWebPage[junk][1]) and match(" ",TheWebPage[junk][1])
> > > > do
> > > >
> > > > errors out with :
> > > >
> > > > attempt to subscript an atom
> > > > (reading from it)
> > > >
> > > > Since TheWebPage[junk] is a sequence,
> > > > TheWebPage[junk][1] is a sequence, where is it an atom??
> > > >
> > > > Kat
> > >
> 
> Kat,
> what do you get if you code it this way instead...

I recoded the whole block already. 

>  while 1 do
>     if not sequence(TheWebPage[junk][1]) then
>         puts(1, "Not a sequence\n")
>         exit
>     end if
>     if not match(" ",TheWebPage[junk][1]) then
>         exit
>     end if
>  . . .
>  end while
> 
> However, I take it that 'TheWebPage[junk]' is supposed to contain a line of
> text. If that is so, then I would expect that 'TheWebPage[junk][1]' would
> contain an atom - namely the first character in the line.

That stands to reason, however, when i "if sequence()" on it (and it passes), 
then "length()" on it (and it passes), and then it crashes when i attempt to 
use match() on it, and returns that match needs a sequence, or i am 
attempting to read from the atom, it's wasting my time. I want to know if 
there is a " " or ' ' or 32 anywhere there, regardless of it's type. I know i 
assigned a sequence to it, because the only atoms i declared are used as 
integers.

Kat

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu