1. RE: atoms, grrrrrr
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:
sequence s1
integer at1
-- first define at1, and s1
at1 = 3
-- data:
s1 = { "the", "cat", "ate", "big", "dinner" }
if at1 < length( s1 ) then
puts( 1, "at1 < length(s1)" )
else
puts( 1, "at1 > length(s1)" )
end if
-- Brian
Kat wrote:
> Can someone explain this to me:
>
> code:
> sequence s1
> integer at1
>
> if at1 < length( s1 )
>
> 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'}}
>
> at1 = 3
>
> error:
> true/false condition must be an ATOM
>
>
> me:
> Kat
>
>
2. RE: atoms, grrrrrr
Kat,
What I usually do in a case like this is either trace it or just put the
following before the test:
? at1
? s1
if at1 < length( s1 ) then...
That should provide enough insight to solve your problem.
-- Brian
Kat wrote:
> 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
>
>
3. RE: atoms, grrrrrr
Hi again Kat,
Why dont you just use "trace(1)" and single step
through the problem code? This way you can isolate
the line thats causing the problem, then if you still
cant find the error post that section of the code and
mark the exact line that triggered the error.
Good luck with it.
--Al
4. RE: atoms, grrrrrr
On 21 Feb 2001, at 14:00, Brian Broker wrote:
> Kat,
>
> What I usually do in a case like this is either trace it or just put the
> following before the test:
>
> ? at1
3
> ? s1
s1 is a nested sequence, which is what it should be, so it won't ?"", but ex.err
and the
tracer window says it is:
s1 = {{116't',104'h',101'e'},{99'c',97'a',116't'},{97'a',116't',101'e'},
which is correct, as it should be.
? length(s1)
will print out: 3
then
if at1 < length( s1 )
crashes.
Robert, might i have a bad version of exw.exe? I seem to be the only one having
these
odd problems.
Kat
PS!!!!!!!
AAARRRRRRRGGGGGGG
the ex.err was reporting the wrong line, see where i changed put in equal()
below
<sigh>:
if at1 < length( s1 )
and at2 < length( s2 )
and equal(s1[at1] , s2[at2+1])
and equal(s1[at1+1] , s2[at2]) then
left &= s1[at1..at1+1]
right &= s2[at2..at2+1]
at1 += 1
at2 += 1
exit
end if
5. RE: atoms, grrrrrr
On 21 Feb 2001, at 14:34, Al Getz wrote:
> Hi again Kat,
> Why dont you just use "trace(1)" and single step
> through the problem code? This way you can isolate
> the line thats causing the problem, then if you still
> cant find the error post that section of the code and
> mark the exact line that triggered the error.
I did use trace(1), and it faulted on the line with the < in it,, but as it
turns out, it was
the wrong line.
Kat
6. RE: atoms, grrrrrr
Kat wrote:
> s1 is a nested sequence, which is what it should be, so it won't ?"",
> but ex.err and the
Kat, glad to hear that you figured out your problem. BTW, '?' will
print anything, including nested sequences. In this case, it would
print:
101,114}}
-- Brian
7. RE: atoms, grrrrrr
Hi again Kat,
Did you remember to place the word 'then' in the conditional
statement? I noticed you hadnt typed that in the post.
If 'then' is missing the interpreter might look at too much
data up to the next 'then' and determine that there is something
other then an atom in the conditional line.
Hope that helps.
--Al
8. Re: RE: atoms, grrrrrr
--------------Boundary-00=_5SW4QL80000000000000
--------------Boundary-00=_5SW4LVC0000000000000
charset="iso-8859-1"
sequence s1
integer at1
at1 =3D 3
s1 =3D {"the","cat","ate","big","dinner"}
? length(s1)
if at1 < length( s1 ) then
puts(1,"it works!")
end if
This worked for me.
Hope this help,
Guillermo Bonveh=ED
AKA: Caballero Rojo - Red Knight - Knixeur
-------Original Message-------
From: Kat=20
To: EUforum=20
Subject: RE: atoms, grrrrrr
On 21 Feb 2001, at 14:00, Brian Broker wrote:
> Kat,
>=20
> What I usually do in a case like this is either trace it or just put th=
e=20
> following before the test:
>=20
> ? at1
3
> ? s1
s1 is a nested sequence, which is what it should be, so it won't ?"", but=
ex.err and the=20
tracer window says it is:
s1 =3D {{116't',104'h',101'e'},{99'c',97'a',116't'},{97'a',116't',101'e'}=
,
which is correct, as it should be.
? length(s1)
will print out: 3
then=20
if at1 < length( s1 )
crashes.
Robert, might i have a bad version of exw.exe? I seem to be the only one =
having these=20
odd problems.
Kat
PS!!!!!!!
AAARRRRRRRGGGGGGG
the ex.err was reporting the wrong line, see where i changed put in equal=
() below=20
<sigh>:
if at1 < length( s1 )
and at2 < length( s2 )
and equal(s1[at1] , s2[at2+1])
and equal(s1[at1+1] , s2[at2]) then
left &=3D s1[at1..at1+1]
right &=3D s2[at2..at2+1]
at1 +=3D 1
at2 +=3D 1
exit
end if
--------------Boundary-00=_5SW4LVC0000000000000
--------------Boundary-00=_5SW4G6G0000000000000
charset="iso-8859-1"
<html>
<head>
<meta name=3D"GENERATOR" content=3D"IncrediMail 1.0">
</head>
<BODY background=3D"" bgColor=3D#ffffff style=3D"BACKGROUND-POSITION: 0px=
0px; FONT-FAMILY: Arial" scroll=3Dyes ORGYPOS=3D"0">
<TABLE border=3D0 cellPadding=3D2 cellSpacing=3D0 id=3DINCREDIMAINTABLE w=
idth=3D"100%">
<TBODY>
<TR>
<TD id=3DINCREDIHEADER width=3D"100%"></TD>
</TR>
<TR>
<TD id=3DINCREDITEXTREGION width=3D"100%">
<DIV>sequence s1<BR>integer at1</DIV>
<DIV>at1 =3D 3</DIV>
<DIV>s1 =3D {"the","cat","ate","big","dinner"}</DIV>
<DIV>? length(s1)</DIV>
<DIV>if at1 < length( s1 ) then<BR> puts(1,"it=
=20
works!")<BR>end if</DIV>
<DIV> </DIV>
<DIV>This worked for me.</DIV>
<DIV> </DIV>
<DIV>Hope this help,</DIV>
<DIV> Guillermo Bonveh=ED</DIV>
<DIV> AKA: Caballero Rojo - Red Knight - Knixeur<=
/DIV>
<DIV> </DIV>
<DIV><I>-------Original Message-------</I></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV dir=3Dltr id=3Dfromshowfield><U><I>From:</I></U><B> Kat=20
<GERTIE at PELL.NET></B></DIV>
<DIV dir=3Dltr id=3Dtoshowfield><U><I>To:</I></U><B> EUforum=20
<EUFORUM at TOPICA.COM></B></DIV>
<DIV dir=3Dltr id=3Dsubjectshowfield><U><I>Subject:</I></U><B> RE: =
atoms,=20
grrrrrr</B></DIV><BR>On 21 Feb 2001, at 14:00, Brian Broker=20
wrote:<BR><BR>> Kat,<BR>> <BR>> What I usually do in a cas=
e like=20
this is either trace it or just put the <BR>> following before t=
he=20
test:<BR>> <BR>> ? at1<BR><BR>3<BR><BR>> ? s1<BR><BR>s1 is=
a=20
nested sequence, which is what it should be, so it won't ?"", but e=
x.err=20
and the <BR>tracer window says it is:<BR>s1 =3D=20
{{116't',104'h',101'e'},{99'c',97'a',116't'},{97'a',116't',101'e'},=
>which=20
is correct, as it should be.<BR><BR>? length(s1)<BR>will print out:=
=20
3<BR><BR>then <BR>if at1 < length( s1 )<BR>crashes.<BR><BR>Rober=
t,=20
might i have a bad version of exw.exe? I seem to be the only one ha=
ving=20
these <BR>odd=20
problems.<BR><BR>Kat<BR><BR>PS!!!!!!!<BR>AAARRRRRRRGGGGGGG<BR>the e=
x.err=20
was reporting the wrong line, see where i changed put in equal() be=
low=20
<BR><sigh>:<BR><BR>if at1 < length( s1 )<BR> a=
nd at2=20
< length( s2 )<BR> and equal(s1[at1] ,=20
s2[at2+1])<BR> and equal(s1[at1+1] , s2[at2])=20
then<BR> left &=3D=20
s1[at1..at1+1]<BR> right =
&=3D=20
s2[at2..at2+1]<BR> at1 +=3D=
=20
1<BR> at2 +=3D=20
1<BR> exit<BR> =
;end=20
Discussions on Topics You=20
Choose.<BR>http://www.topica.com/partner/tag01<BR></TD>
</TR>
<TR>
<TD id=3DINCREDIFOOTER width=3D"100%">
=09<TABLE cellPadding=3D0 cellSpacing=3D0 width=3D"100%">
=09<TBODY>
=09<TR>
=09<TD width=3D"100%"></TD>
=09<TD align=3Dmiddle id=3DINCREDISOUND vAlign=3Dbottom></TD>
=09<TD align=3Dmiddle id=3DINCREDIANIM vAlign=3Dbottom></TD>
=09</TR>
=09</TBODY>
=09</TABLE>
</TD>
</TR>
</TBODY>
</TABLE><SPAN=20
id=3DIncrediStamp>
<P align=3Dleft><FONT face=3D"Arial, Helvetica, sans-serif"=20
evolved</B> - </FONT><A href=3D"http://www.incredimail.com/imstamp26.html=
"><FONT=20
face=3D"Times New Roman" size=3D3><B><U>Click=20
Here</U></B></FONT></A></P></SPAN></FONT>
</html>
--------------Boundary-00=_5SW4G6G0000000000000--
--------------Boundary-00=_5SW4LVC0000000000000--
--------------Boundary-00=_5SW4QL80000000000000--