Re: atoms, grrrrrr
On 21 Feb 2001, at 11:49, Euman wrote:
> You never assigned a value to at1 before you
> asked it whether it was less than another value
Peoples, i did provide the values, as printed out in ex.err, they had values.
On 21 Feb 2001, at 13:40, Ted Fines wrote:
> The following code works, and should output a 5 and then a 3, if the
> variables are left unchanged. misc.e is included for the sleep() function.
>
> length(s) gets evaluated twice in the code and both times works. Even if
> you set s="", it still functions properly.
>
> If I were you, I'd add these four lines before my comparison of the integer
> and length(s)...
> puts(1,sprintf("%d\n",length(s)))
> for c=1 to length(s) do
> puts(1,"s[" & sprintf("%d",c) & "]=" & s[c] & "\n")
> end for
> ...just so you can see if s is what you think it is.
And it is what i thought it is, as i assigned them and as printed out in ex.err.
On 21 Feb 2001, at 11:49, Brian Broker wrote:
> Kat,
>
> You have not provided enough info... Perhaps you could send a snippet
> of actual code that produces the same error. The following program
> works great:
I did, it's:
if at1 < length( s1 )
> sequence s1
> integer at1
>
> -- first define at1, and s1
> at1 = 3
> -- data:
> --s1={116't',104'h',101'e'},{99'c',97'a',116't'}{97'a',116't',101'e'},
> --{98'b',105'i',103'g'},{100'd',105'i',110'n',110'n',101'e',114'r'}}
> s1 = { "the", "cat", "ate", "big", "dinner" }
That is how i defined it, the line just above is what ex.err printed out, which
is the
same thing and correct, right?
>
> if at1 < length( s1 ) then
> puts( 1, "at1 < length(s1)" )
> else
> puts( 1, "at1 > length(s1)" )
> end if
So why is the code you wrote, which is exactly the code i put into this other
program,
working by itself, and not in the program? The boolean test line is the same,
and the
vars are the same.
Kat
|
Not Categorized, Please Help
|
|